ON=@kill - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: ON=@kill (/Thread-ON-kill) Pages: 1 2 |
ON=@kill - Van Glan Bloom - 03-26-2014 02:47 PM Good night, A few months ago I was working on a script, but for various reasons stopped scriptar, now back to move the scripts UO and gave me a problem. I created an item that should help the player to have a bonus in gold for killing a monster, but that gold is not being added to the MOB. I tried several ways but it has not. What I have is this: [Events e_more_money] ON=@kill if (<SRC.isplayer>) && (<SRC.isevent.e_exp>) serv.newitem i_gold,{1000 2000},<SRC> endif RE: ON=@kill - XuN - 03-26-2014 06:52 PM IF you want the gold to be added to the mob, then you are using the wrong reference in the serv.newitem. Code: serv.newitem i_gold,{1000 2000},<argo> RE: ON=@kill - Van Glan Bloom - 03-27-2014 02:47 AM I changed the script and put it this way: [Events e_more_money] ON=@kill if (<argo.isevent.e_exp>) serv.newitem i_gold,{1000 2000},<argo> src.message TESTE KILL TESTE KILL endif and i have this : [Events e_more_money] ON=@kill IF (<ARGO.NPC>) IF !(RAND(<eval <LOCAL.e_exp>>)) f_more_money NEW.CONT <ARGO.UID> ENDIF RETURN 0 ENDIF When I kill the MOB with GM, the script works, but when testo with the player does not work. Where am I going wrong? RE: ON=@kill - Mordaunt - 03-27-2014 04:19 AM Does the player have the event? RE: ON=@kill - Van Glan Bloom - 03-27-2014 05:50 AM Yes the player have the event. The player equip one item,it equips the item and receives the event . This is a segment of the script : ON=@EQUIP IF (<src.findlayer.9.baseid>==i_arken_talisman) src.events=+e_more_money else RETURN 0 endif src.moddex += 5 src.modint += 5 src.modstr += 5 ON=@UNEQUIP src.events=-e_more_money src.moddex -= 5 src.modint -= 5 src.modstr -= 5 RE: ON=@kill - XuN - 03-27-2014 07:07 AM (03-26-2014 06:52 PM)XuN Wrote: IF you want the gold to be added to the mob, then you are using the wrong reference in the serv.newitem. I talked about the serv.newitem, not the IF checking for the event, src is the killer and argo the killed. RE: ON=@kill - Van Glan Bloom - 03-27-2014 09:35 AM I modified the script for how You mentioned: [Events e_more_money] on = @ kill if (<src.isplayer>) && (<src.isevent.e_exp>) serv.newitem i_gold {1000 2000}, <argo> endif Remains the same, the mob does not drop the extra gold. I can not understand where I am going wrong RE: ON=@kill - darksun84 - 03-27-2014 10:07 AM try to enable EF_FixKillTrigger = 00000002 in the sphere.ini RE: ON=@kill - Van Glan Bloom - 03-27-2014 01:48 PM In Sphere.Ini i dont have the variable with that name. I need to create? If yes, at what location? RE: ON=@kill - Alaric - 03-27-2014 08:14 PM You are checking if the victim is player and has the event e_exp. Do you really want that? If yes, are the conditions really true? Code: if (<src.isplayer>) && (<src.isevent.e_exp>) In the first post you said only bonus from a mob... I assume you should give the event only a player and check only existance of event e_exp and if it is NOT a player. SRC=VICTIM ARGO=KILLER |