View Single Post
  #7  
Old 06-16-2010, 09:39 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by steve View Post
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!");
}
}
}
Reply With Quote