SphereCommunity
Double Target - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Double Target (/Thread-Double-Target)



Double Target - mlyon83 - 05-18-2013 02:46 AM

I've written a script to tame, and it works fine, however, I'm getting the default target for taming and my own custom target. How would I resolve this?

Code:
ELSEIF (<SRC.ACTION> == skill_Taming)
    //SRC.ACTION=-1
    IF (<SRC.TAG.TAMING_STATUS> == 1)
        SRC.SYSMESSAGE @00 You're already taming a creature. Please wait.
    ELSE
        SRC.TAG.TAMING_STATUS=1
        SRC.NEWITEM=i_player_tame_start
        SRC.ACT.EQUIP
    ENDIF
    RETURN 1
ENDIF

[ITEMDEF i_player_tame_start]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="Player Taming Target Memory"

ON=@Equip
LINK=<SRC.UID>
TARGET

ON=@Targon_Char
IF (<LINK.TARG.NPC>)
    IF (<LINK.TARG.DISTANCE> >= 5)
        LINK.SYSMESSAGE @00 You're too far away to tame that creature.
    ELSEIF (<LINK.TARG.TAMING> <= 0.0)
        LINK.SYSMESSAGE @00 You cannot tame that creature.
    ELSE
        IF (<LINK.TARG.TAMING> <= <LINK.TAMING>)
            LINK.TAG.TAMING_UID=<LINK.TARG.UID>
            LINK.TAG.TAMING_NAME=<LINK.TARG.NAME>
            LINK.MESSAGE @00 You begin to tame <LINK.TARG.NAME>...
            TIMER=3
        ELSE
            LINK.SYSMESSAGE @00 You lack sufficient skill to tame that creature.
            REMOVE
        ENDIF
    ENDIF
ENDIF
RETURN 1

ON=@Timer
//Check distance
LINK.TAG.TAMING_COUNT=<LINK.TAG.TAMING_COUNT>+1
LINK.TAG.TAMING_RANDOM=8
IF (<LINK.TAG.TAMING_COUNT> >= <LINK.TAG.TAMING_RANDOM>)
    LINK.SYSMESSAGE @00 You successfully capture the love and trust of <LINK.TAG.TAMING_NAME>.
    LINK.TAG.TAMING_STATUS=0
    LINK.TAG.TAMING_COUNT=0
        //Set memory to pet owner
    REMOVE
ELSE
    DORAND 10
        LINK.SAY="You're so cute, <LINK.TAG.TAMING_NAME>. I just want to eat you up."
        LINK.SAY="Come here, <LINK.TAG.TAMING_NAME>. I won't hurt you."
        LINK.SAY="Awwwh... you're so precious, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="I love you, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Come into my open arms, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="You're the most adorable thing I've ever seen, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="I would never trade you in for another <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Give me a kiss, <LINK.TAG.TAMING_NAME>, you cute bastard."
        LINK.SAY="I just want to cuddle you, <LINK.TAG.TAMING_NAME>."
        LINK.SAY="Come here, <LINK.TAG.TAMING_NAME>. I won't eat you."
    ENDDO
    TIMER=5
ENDIF
RETURN 1

ON=@Targon_Cancel
LINK.SYSMESSAGE @00 You cancel your target.
REMOVE
RETURN 1



RE: Double Target - RanXerox - 05-18-2013 03:37 AM

Show us your skill definition for taming...


RE: Double Target - mlyon83 - 05-18-2013 03:56 AM

(05-18-2013 03:37 AM)RanXerox Wrote:  Show us your skill definition for taming...

[SKILL 35]
DEFNAME=Skill_Taming
KEY=Taming
TITLE=Animal Tamer
PROMPT_MSG=Tame which animal?
DELAY=2.0
STAT_STR=30
STAT_INT=40
STAT_DEX=60
BONUS_STR=30
BONUS_DEX=10
BONUS_INT=60
BONUS_STATS=20
ADV_RATE=10.0,200.0,800.0

ON=@Fail
SRC.SYSMESSAGE @00 You fail to tame the creature.

ON=@Abort
SRC.SYSMESSAGE @00 You give up trying to tame the creature.


RE: Double Target - RanXerox - 05-18-2013 06:02 AM

The only way to prevent the built-in target of the taming skill from showing up is to change the taming skill... add: FLAGS=SKF_SCRIPTED

The down side to this is you probably need to re-implement all the rest of the built-in behaviour (skillgain, success, fail, etc) in your script.

The alternative is to re-implement your idea using the actual skill triggers... you can find an example of this technique in the SCP: http://code.google.com/p/sphere-community-pack/source/browse/trunk/scripts/skills/sphere_skill_animaltaming.scp