ok its time to show the almighty
OnPCUseSkillEvent
@
@classy5
although the topic title has the word 'Simple', but this isn't simple at all
because have to create a new skill and create a new item
hmm ... since have to move back the target of the monster to original position, have to use getmapxy with mobs
https://github.com/HerculesWS/Hercules/pull/871
so ...
confimportOnPCUseSkillEvent.txt
warp_target,"warp_target::Onwarp".dbreskill_db.txt
1305,15,0,1,0,0,0,9,0,no,0,0x0,0,none,0, warp_target,warp_target.dbreskill_require_db.txt
1305,0,0,0,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.dbreskill_cast_db.txt
1305,0,0,0,0,0,100,0.dbitem_db2.conf
{ Id: 32499 AegisName: "item_warp_target" Name: "warp_target" Type: 11 Weight: 1 Script: <" itemskill warp_target,1; ">},.clientSystemitemInfo.lub
[32499] = { unidentifiedDisplayName = "Warp Target", unidentifiedResourceName = "파리의날개", unidentifiedDescriptionName = { "Warp the target into guild_vs2 and warp back in 10 seconds", }, identifiedDisplayName = "Warp Target", identifiedResourceName = "파리의날개", identifiedDescriptionName = { "Warp the target into guild_vs2 and warp back in 10 seconds", }, slotCount = 0, ClassNum = 0 },.dataluafiles514lua filesskillinfozskillid.lub
warp_target = 1305,.dataluafiles514lua filesskillinfozskillinfolist.lub
[SKID.warp_target] = { "warp_target"; SkillName = "Warp Target Unit", MaxLv = 1, Type = "Quest", SpAmount = { 0 }, bSeperateLv = true, AttackRange = { 15 }, },.and finally the npc script
- script warp_target FAKE_NPC,{Onwarp: .@gid = @useskilltarget; getmapxy .@map$, .@x, .@y, UNITTYPE_PC; getmapxy .@map$, .@x2, .@y2, UNITTYPE_MOB, .@gid; unitwarp .@gid, "guild_vs2", 50,50; warp "guild_vs2", 50,50; .@origin = getcharid(3); sleep 10000; // 10 seconds if ( attachrid(.@origin) ) warp .@map$, .@x, .@y; if ( !getmapxy( .@dummy$, .@dummy, .@dummy, UNITTYPE_MOB, .@gid ) ) { // announce "still alive !", bc_all; unitwarp .@gid, .@map$, .@x2, .@y2; } end;}.Have Fun figure this out!
EDIT: seems skill name and item name must not the same, so rename into "item_warp_target"