This is an example of a script I am trying to convert from perl to lua
To be stored in global/spells/spellid.lua
The spell is Targettype 6 (self) and when cast is supposed to spawn an NPC.
sub EVENT_SPELL_EFFECT_CLIENT {
$ClientID = $entity_list->GetClientByID($caster_id);
my $x = $ClientID->GetX();
my $y = $ClientID->GetY();
my $z = $ClientID->GetZ();
my $h = $ClientID->GetHeading();
quest::spawn2(1079,0,0,$x+5,$y+5,$z,$h);
} #Close event
|