I'm going to try and explain this carefully so that a new player can understand how this works. My entire reason for even starting this was because there is no information on scripts UNLESS you hard code the beastlord pets through the pets.cpp file.
I wanted to avoid that! So, I attempted to make a script that anyone could use without having to take months to learn how every process works.
Steps: (This is assuming that you've already downloaded the emulator/peq/etc to run your own servers, that is a completely different topic)
1) You must create .pl files in your (emulator/server directory) quests/global folder.
2) Depending on if you use my method or Huppy's method (I will provide it) to what you name these files. Mine would be the actual spell / NPC ID and Huppy's would be the name of the spell.
3) Examples:
My Method: 515.pl, 516.pl, 517.pl, 518.pl, etc.
Huppy's Method: BLpet09, BLpet16, BLpet22, BLpet26, BLpet31, etc.
4) All you do is copy/paste the codes into these .pl files and place them into the quests/global folder.
5) My method requires a little more work than Huppy's, so depending on how you want to do it, they both work flawlessly as I tried both methods on every race as a beastlord at every level of the pets.
I.E. My method requires you to change the: if ($npc->GetNPCTypeID() == 837) to if ($npc->GetNPCTypeID() == 515) or if ($npc->GetNPCTypeID() == 516), etc. Depending on what spell you're casting.
Huppy's Method: All you have to do is name the .pl files and use the SAME code in each
MY METHOD:
Code:
sub EVENT_SPAWN {
if ($npc->GetNPCTypeID() == 515) {
my $petowner = $entity_list->GetClientByID($npc->GetOwnerID());
if ($petowner->GetRace() == 1) { # Human
$npc->SetRace(468);
$npc->ChangeSize(12);
}
elsif ($petowner->GetRace() == 2) { # Barbarian
$npc->SetRace(528);
$npc->ChangeSize(4);
}
elsif ($petowner->GetRace() == 3) { # Erudite
$npc->SetRace(602);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 4) { # Wood Elf
$npc->SetRace(64);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 5) { # High Elf
$npc->SetRace(473);
$npc->ChangeSize(5);
}
elsif ($petowner->GetRace() == 6) { # Dark Elf
$npc->SetRace(365);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 7) { # Half Elf
$npc->SetRace(560);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 8) { # Dwarf
$npc->SetRace(16);
$npc->ChangeSize(6);
}
elsif ($petowner->GetRace() == 9) { # Troll
$npc->SetRace(259);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 10) { # Ogre
$npc->SetRace(135);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 11) { # Halfling
$npc->SetRace(321);
$npc->ChangeSize(6);
}
elsif ($petowner->GetRace() == 12) { # Gnome
$npc->SetRace(570);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 128) { # Iksar
$npc->SetRace(389);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 330) { # Froglok
$npc->SetRace(245);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 522) { # Drakkin
$npc->SetRace(611);
$npc->ChangeSize(7);
}
}
}
REMEMBER TO CHANGE THE 515 to the number of the ID in EACH .pl file.
HUPPY'S METHOD (BE SURE TO GIVE HIM CREDIT)
Code:
sub EVENT_SPAWN {
my $petowner = $entity_list->GetClientByID($npc->GetOwnerID());
if ($petowner->GetRace() == 1) { # Human
$npc->SetRace(468);
$npc->ChangeSize(12);
}
elsif ($petowner->GetRace() == 2) { # Barbarian
$npc->SetRace(528);
$npc->ChangeSize(4);
}
elsif ($petowner->GetRace() == 3) { # Erudite
$npc->SetRace(602);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 4) { # Wood Elf
$npc->SetRace(64);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 5) { # High Elf
$npc->SetRace(473);
$npc->ChangeSize(5);
}
elsif ($petowner->GetRace() == 6) { # Dark Elf
$npc->SetRace(365);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 7) { # Half Elf
$npc->SetRace(560);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 8) { # Dwarf
$npc->SetRace(16);
$npc->ChangeSize(6);
}
elsif ($petowner->GetRace() == 9) { # Troll
$npc->SetRace(259);
$npc->ChangeSize(8);
}
elsif ($petowner->GetRace() == 10) { # Ogre
$npc->SetRace(135);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 11) { # Halfling
$npc->SetRace(321);
$npc->ChangeSize(6);
}
elsif ($petowner->GetRace() == 12) { # Gnome
$npc->SetRace(570);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 128) { # Iksar
$npc->SetRace(389);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 330) { # Froglok
$npc->SetRace(245);
$npc->ChangeSize(7);
}
elsif ($petowner->GetRace() == 522) { # Drakkin
$npc->SetRace(611);
$npc->ChangeSize(7);
}
}
Remember to name each .pl file the name of the spell.
NOTE: PLEASE NOTE THAT YOU MUST CREATE ALL THE SPELL/ID FILES NO MATTER WHICH METHOD YOU USE. DO NOT FORGET TO #reloadworld AFTER CHANGING THESE FILES!
I.E.
BLpet47p15, BLpet49p15, etc (HUPPY'S METHOD).
894, 895, 896, 897, etc (MY METHOD).
Both methods list all races except the Vah Shir. So you'd have to add these with the race ID of the Vah Shir. I figured we'd keep them traditional.
You can find these in the npc_types using a database editor. I use HeidiSQL.
Please enjoy the beastlords