Quote:
Originally Posted by steve
I guess I don't understand what exactly this is/does.
|
Allows the objects (tradeskill containers, which can be substituted with door models) in the world to be controlled via perl. There's an objects class which controls all of that. Since doors cannot be despawned and respawned easily in code without a complete rework, (they are loaded from the database exclusively), I chose this instead. For example, if you wanted to move a forge around with db ID 24 to an NPC, you would do something similar to this:
Code:
sub EVENT_SAY {
if($text=~/hail/i)
{
my $ent = entity_list.GetObjectByDBID(24);
if($ent)
{
$ent->SetLocation($npc->GetX(), $npc->GetY(), $npc->GetZ());
$ent->SetHeading($npc->GetHeading());
quest::say("Object moved to my location!");
}
}
}