grimmm Posted July 17, 2018 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 25 Reputation: 1 Joined: 08/16/12 Last Seen: August 29, 2018 Share Posted July 17, 2018 Hello everyone! Can someone tell me why I can not make this npc work correctly? 1@pam,0,0,0 script #PCHealMR FAKE_NPC,{ end; OnPCLoadMapEvent: if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) { Beginning: message strcharinfo(PC_NAME),"Test AAAAAAAAAA Word"; addtimer 5000, instance_npcname(strnpcinfo(2)) + "::On5secs"; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; end; On5secs: goto Beginning; end; } end; OnPCDieEvent: if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) { deltimer instance_npcname(strnpcinfo(0)) + "::On5secs"; end; } end; OnInit: OnInstanceInit: .@map$ = "1@pam"; setmapflag .@map$,mf_loadevent; end; } ty! Quote Link to comment Share on other sites More sharing options...
0 Capuche Posted July 17, 2018 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 17, 2018 (edited) PC_NAME is hercules constant strnpcinfo(0) should be used with addtimer instead of strnpcinfo(2) you're searching the instance npc name of non-instance npc too under oninstanceinit mf_loadevent is only set for non-instance map : this script is not running on instance map Edited July 17, 2018 by Capuche 1 Quote Link to comment Share on other sites More sharing options...
0 grimmm Posted July 17, 2018 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 25 Reputation: 1 Joined: 08/16/12 Last Seen: August 29, 2018 Author Share Posted July 17, 2018 (edited) 3 hours ago, Capuche said: PC_NAME is hercules constant strnpcinfo(0) should be used with addtimer instead of strnpcinfo(2) you're searching the instance npc name of non-instance npc too under oninstanceinit mf_loadevent is only set for non-instance map : this script is not running on instance map thank you, I'll see what happens to me ex: OnTouch Edited July 17, 2018 by grimmm Quote Link to comment Share on other sites More sharing options...
Question
grimmm
Hello everyone! Can someone tell me why I can not make this npc work correctly?
1@pam,0,0,0 script #PCHealMR FAKE_NPC,{ end; OnPCLoadMapEvent: if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) { Beginning: message strcharinfo(PC_NAME),"Test AAAAAAAAAA Word"; addtimer 5000, instance_npcname(strnpcinfo(2)) + "::On5secs"; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; sleep2 1700; // 1 second heal 5000,5000; end; On5secs: goto Beginning; end; } end; OnPCDieEvent: if (strcharinfo(3) == .@map$ || strcharinfo(3) == instance_mapname(.@map$) ) { deltimer instance_npcname(strnpcinfo(0)) + "::On5secs"; end; } end; OnInit: OnInstanceInit: .@map$ = "1@pam"; setmapflag .@map$,mf_loadevent; end; }
ty!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.