SphereCommunity
Some problem .... - Printable Version

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

Pages: 1 2 3


Some problem .... - an0n!m0use - 09-08-2013 10:33 PM

1) I have 2 item's ... with 2 events:

Holy Ring:
Features: Every third spell Paralyze has no effect on the owner of ring. ( Plz remake this script )
Notice: It must be working when you cast paralyze !
Code:
[EVENTS e_anti_paralyze]
On=@SpellEffect
    if rand(3)==1
        if (<argn>==38)
            effect=3,i_fx_glow,5,15,0
            return 1
        endif
    endif

Ring of Heaven:
Features: Every third spell Paralyze has no effect on the owner of ring and paralyze the attacker. ( Plz remake this script )
Notice: It must be working when you cast paralyze !
Code:
[EVENTS e_anti_paralyze_reflect]
On=@SpellEffect
    if (<eval <argn1>>==38)
        if !(<tag0.reflectivering>)
        tag.reflectivering = 1
    else
        if <tag0.reflectivering> == 2
        src.spelleffect 38,100
        src.sysmessage Paralyze has reflected on <src.name>
        tag.reflectivering=
    else
        tag.reflectivering += 1
        endif
        endif
    endif


But when you attack another player ... with special axe and with these properties:

Code:
On=@Damage
    if rand(3)=1
        if !(<src.findlayer(25).uid>==0)
            cont.say Agrrrhh!
            cont.src.dclick
            src.sound 273
        else
            cont.say Agrrrhh!
            src.sound 273
            serv.newitem i_paralyze
            new.timer = 1,5
            new.equip <src>
            src.sfx snd_spell_paralyze
        endif
    endif

Code:
[itemdef i_paralyze]
NAME=Paralyze
ID=i_memory
TYPE=t_eq_script

On=@TIMER
    cont.spelleffect s_paralyze,100.0
    remove
    return 1


I have crash SphereSrv Sad

[Image: 83777be5502d.jpg]



2) I have a equip stone ... when you can get some animal ...

Code:
[CHARDEF 0dc]
DEFNAME=c_llama
NAME=Llama
SOUND=snd_ANIMALS_LLAMA3
ICON=i_pet_LLAMA
CAN=MT_WALK|MT_RUN
ANIM=01fff
DAM=2,6
ARMOR=8
RESOURCES=7 i_ribs_raw,2 i_fur_light
FOODTYPE=5 t_crops, 5 t_fruit, 5 t_grain, 5 i_hay, 64 t_grass
//SHELTER=r_stables,spk_human_prime
DESIRES=c_llama,c_llama_pack,spk_human_prime
DESCRIPTION=Llama
SUBSECTION=Land (Domestic)
CATEGORY=Animals

ON=@Create
    NPC=brain_animal
    EVENTS = e_brain

Code:
[EVENTS e_brain]
On=@Click
    remove
    return 1

On=@DClick
    remove
    return 1

Code:
On=1
    if (<distance>>3)
        src.sysmessage You can't reach that
    elseif (<src.findlayer.25.uid>)
        src.sysmessage @55 You are already mounted!
        sdialog d_eq_stone
    else
        serv.newitem=i_mt_llama
        new.name=Llama
        new.more2 <src>
        new.equip <src>
    endif
    return 1

Code:
On=2
    if (<distance>>3)
        src.sysmessage You can't reach that
    elseif (<src.findlayer.25.uid>)
        src.sysmessage @55 You are already mounted!
        sdialog d_eq_stone
    else
        serv.newitem=i_mt_ostard_zostrich
        new.name=Zostrich
        new.more2 <src>
        new.equip <src>
    endif
    return 1

I did like that because after Wolrd Save its not removed ... But a have other problem ... Axe with this trigger: cont.src.dclick not working Sad


RE: Some problem .... - Mordaunt - 09-09-2013 12:47 AM

I'm on a mobile browser right now so I am not going to script anything but...


ON=1 & ON=2 are gump buttons.... I see no evidence of you having used them as such.

cont.src.dclick on an axe? why would that ever work?

the trigger is ON=@DCLICK
with code following it being src.blahblahblah


RE: Some problem .... - RanXerox - 09-09-2013 03:03 AM

You do not have to EVAL ARGN1 because ARGN is already a number.
You cannot assign a value to a variable in an IF statement.
The SPELLEFFECT function probably needs more than 2 arguments to do what you want.
@Damage on an item is triggered when the item is damaged... not when the item is used to do damage to something (or someone) else.
You cannot set a comma separated list of values to a TIMER.


RE: Some problem .... - an0n!m0use - 09-09-2013 04:17 AM

(09-09-2013 12:47 AM)Mordaunt Wrote:  ON=1 & ON=2 are gump buttons.... I see no evidence of you having used them as such.
I mean that buttons to take an animal from the PvP Stone ...
On=1 (i_mt_llama)
On=2 (i_mt_ostard_zostrich)

Quote:cont.src.dclick on an axe? why would that ever work?
Barbarian Axe with this properties: You have a chance (rand(3)=1) for a critical hit ... if you on horse - dismount you, else paralyze ...
Code:
On=@Damage
    if rand(3)=1
        if !(<src.findlayer(25).uid>==0)
            cont.say Agrrrhh!
            cont.src.dclick
            src.sound 273
        else
            cont.say Agrrrhh!
            src.sound 273
            serv.newitem i_paralyze
            new.timer = 1
            new.equip <src>
            src.sfx snd_spell_paralyze
        endif
    endif



(09-09-2013 03:03 AM)RanXerox Wrote:  You do not have to EVAL ARGN1 because ARGN is already a number.
You cannot assign a value to a variable in an IF statement.
The SPELLEFFECT function probably needs more than 2 arguments to do what you want.

Can you help me to make these rings ? I do not understand how to realize Sad

1) Holy Ring:
Every third paralyze has no effect on owner of the ring.

2) Ring of Heaven
Every third paralyze has no effect on owner of the ring, but paralyze the attacker.


RE: Some problem .... - RanXerox - 09-09-2013 06:02 AM

Quote:You do not have to EVAL ARGN1 because ARGN is already a number.

Change this: if (<eval <argn1>>==38)

To this: if (<argn1>==38)

Quote:You cannot assign a value to a variable in an IF statement.

Change this: if rand(3)=1

to This: if rand(3)==1

Quote:The SPELLEFFECT function probably needs more than 2 arguments to do what you want.

SPELLEFFECT spell_id, strength, source_character_uid, source_item_uid

If you want SRC to be affected by a spell "cast" by UID... Change this: src.spelleffect 38,100

To this: src.spelleffect 38,100,<UID>

Otherwise the default choice for the source of the damage gets becomes <SRC> and usually when a entity damages themselves, the damage is prevented...


RE: Some problem .... - an0n!m0use - 09-09-2013 08:41 AM

(09-09-2013 06:02 AM)RanXerox Wrote:  ...
Thx for little manual Smile I solved my problem Veryhappy


How I fix problem with pets? When I take the pet from stone ... Like this:
Code:
serv.newitem=i_mt_llama
new.name=Llama
new.more2 <src>
new.equip <src>

It's working fine! But when player with this axe attacking you:
Code:
On=@Damage
    if rand(3)=1
        if !(<src.findlayer(25).uid>==0)
            cont.say Agrrrhh!
            cont.src.dclick
            src.sound 273
        else
            cont.say Agrrrhh!
            src.sound 273
            serv.newitem i_paralyze
            new.timer = 1
            new.equip <src>
            src.sfx snd_spell_paralyze
        endif
    endif

Dismount (cont.src.dclick) - not always working Doubt

If I did like that:
Code:
serv.newitem=i_mt_llama
new.name=Llama
new.equip <src>

It's removed after World Save Sad


RE: Some problem .... - darksun84 - 09-09-2013 08:53 AM

If you want to dismount the character just use the dismount function Tongue


RE: Some problem .... - RanXerox - 09-09-2013 10:47 AM

Quote:How I fix problem with pets? When I take the pet from stone

The reason that doesn't work is because there is no actual animal.. you are simply mounting the player on a memory...

If you try to create an NPC pet and then "mount" the player on it, that will fail since the player is not the owner of the mount.... You could create the pet memory manually, but its going to be fairly complicated I think. My suggestion is to create the i_pet_llama, put the figurine in the player's backpack, and then dclick that:

SERV.NEWITEM=i_pet_llama,1,<SRC>
NEW.DCLICK

...At least that way the Llama will be standing beside the player, and it will be their pet so all they have to do next is jump on.


RE: Some problem .... - an0n!m0use - 09-09-2013 09:17 PM

(09-09-2013 08:53 AM)darksun84 Wrote:  If you want to dismount the character just use the dismount function Tongue
Now it's working (dismount function ) Veryhappy
If i doing how tell me RanXerox Smile

(09-09-2013 10:47 AM)RanXerox Wrote:  SERV.NEWITEM=i_pet_llama,1,<SRC>
NEW.DCLICK
Is it possible that my char automatically sat on mount ? Because pets from PvP stone is for free and when you dismount - pets die Shifty


RE: Some problem .... - an0n!m0use - 09-14-2013 02:04 AM

The problem is actual Sad