How do I get of an error like this? npc_event: event not found

Lord Ganja

New member
Messages
161
Points
0
Age
34
Location
Ganja World
I use an item that has a bonus that summons a slave clone, and whenever I unequipped the item it will call this functions for the clone to die.

function script unequip_item { killmonster strcharinfo(3), "clonecheck::On"+ getcharid(0); end;}


Here's the script that summons the clone:

clone "prontera",150,150,"clonecheck::On"+getcharid(0), getcharid(0), getcharid(0), 0x8D, 1, 40;

BUT whenever another player killed the clone I got this error.

[Error]: npc_event: event not found [clonecheck::On150031]

Since 150031 is the clone master's id, I don't have any idea how to make the npc event for that so I can avoid the error.

Any ideas? Thanks in advance!

 
clone "prontera",150,150,"clonecheck::On"+getcharid(0), getcharid(0), getcharid(0), 0x8D, 1, 40;

See you have only declared it, " clonecheck::On"+getcharid(0) , so when dead it will call that function, just change it...

 
clone "prontera",150,150,"clonecheck::On"+getcharid(0), getcharid(0), getcharid(0), 0x8D, 1, 40;

See you have only declared it, " clonecheck::On"+getcharid(0) , so when dead it will call that function, just change it...
I don't have idea what to change it. I used On"+getcharid(0) so when the player unequip the item it calls the function unequip_item to kill the specific clone of the user.

If i'm going to change it to something not unique, like clonecheck::OnCloneDead. And someone unequip the item(calls the function unequip_item), all clones on the same map are going to die since they're on the same type of event.

 
@@Lord Ganja

that method was old, you probably got this script from eathena forum

EDIT: found it -> https://www.eathena.ws/board/index.php?s=&showtopic=177722&view=findpost&p=1001559

at that time, *monster and *clone command doesn't return the GID

now that these command returns the GID of the monster, don't have to do that anymore

- script clonecheck FAKE_NPC,{OnInit: setitemscript Bow, "{ getmapxy .@map$, .@x, .@y, 0; @bow_clone = clone( .@map$,.@x,.@y,"clonecheck::OnDead", getcharid(0), getcharid(0), 0x8D, 1, 40 ); }", 1; setitemscript Bow, "{ unitkill @bow_clone; @bow_clone = 0; }", 2;OnDead: end;}.btw move to script support

EDIT : forgot to set @bow_clone back to 0 ... again ... need to fix this bad habit

 
Last edited by a moderator:
@@Lord Ganja

that method was old, you probably got this script from eathena forum

EDIT: found it -> https://www.eathena.ws/board/index.php?s=&showtopic=177722&view=findpost&p=1001559

at that time, *monster and *clone command doesn't return the GID

now that these command returns the GID of the monster, don't have to do that anymore

- script clonecheck FAKE_NPC,{OnInit: setitemscript Bow, "{ getmapxy .@map$, .@x, .@y, 0; @bow_clone = clone( .@map$,.@x,.@y,"clonecheck::OnDead", getcharid(0), getcharid(0), 0x8D, 1, 40 ); }", 1; setitemscript Bow, "{ unitkill @bow_clone; }", 2;OnDead: end;}.btw move to script support
Thank you @@AnnieRuru. I'll try it later once I get to my computer
default_smile.png


 
Back
Top