Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ON=@kill
Author Message
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #1
ON=@kill
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
03-26-2014 02:47 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: ON=@kill
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>
03-26-2014 06:52 PM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #3
RE: ON=@kill
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?
(This post was last modified: 03-27-2014 03:03 AM by Van Glan Bloom.)
03-27-2014 02:47 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: ON=@kill
Does the player have the event?

[Image: 2nis46r.jpg]
03-27-2014 04:19 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #5
RE: ON=@kill
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
03-27-2014 05:50 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: ON=@kill
(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.

Code:
serv.newitem i_gold,{1000 2000},<argo>


I talked about the serv.newitem, not the IF checking for the event, src is the killer and argo the killed.
03-27-2014 07:07 AM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #7
RE: ON=@kill
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
(This post was last modified: 03-27-2014 09:36 AM by Van Glan Bloom.)
03-27-2014 09:35 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: ON=@kill
try to enable

EF_FixKillTrigger = 00000002

in the sphere.ini
03-27-2014 10:07 AM
Find all posts by this user Like Post Quote this message in a reply
Van Glan Bloom
Journeyman
*

Posts: 104
Likes Given: 2
Likes Received: 3 in 3 posts
Joined: Jun 2013
Reputation: 0



Post: #9
RE: ON=@kill
In Sphere.Ini i dont have the variable with that name. I need to create? If yes, at what location?
03-27-2014 01:48 PM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #10
RE: ON=@kill
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>)
if (<argo.isplayer>) && (<src.isevent.e_exp>)
if (<src.isplayer>) && (<argo.isevent.e_exp>)
if (<argo.isplayer>) && (<argo.isevent.e_exp>)
if !(<src.isplayer>) && (<argo.isevent.e_exp>)
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
03-27-2014 08:14 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)