//////////////////////////////////////////////////////////////////////////////// // // Olander's Pack Animals // opa_pack_command // By Don Anderson // dandersonru@msn.com // // This script is called from the NPC HB for Animal Command. // // This is script should be cached. // //////////////////////////////////////////////////////////////////////////////// #include "opa_inc" #include "nbde_inc" void main() { object oNPC = OBJECT_SELF; string sPC = GetLocalString(oNPC, "OPA_OWNER_NAME"); string sPCU = GetLocalString(oNPC, "OPA_OWNER_UNIQUE"); string sCheck = ""; object oPC = GetLocalObject(oNPC,"OPA_OWNER"); string sPlayerName = GetPCPlayerName(oPC); //Player is Gone if(sPlayerName == "") { AssignCommand(oNPC,ClearAllActions(TRUE)); DestroyObject(oNPC,0.1); return; } string sRally = GetLocalString(oPC, "OPA_RALLYPOINT"); SetLocalString(oNPC, "OPA_RALLYPOINT", sRally); //Play Random Voice Chats int D20 = d20(1); switch(D20) { case 1: AssignCommand(oNPC,PlayVoiceChat(VOICE_CHAT_ATTACK)); break; case 2: AssignCommand(oNPC,PlayVoiceChat(VOICE_CHAT_FLEE)); break; case 3: AssignCommand(oNPC,PlayVoiceChat(VOICE_CHAT_PAIN1)); break; } //Player is the Rally if(sRally == "") { AnimalToPlayer(oPC, oNPC); return; } //Waypoint is Rally Point if(sRally == "WP_OPA_" + sPCU) { AnimalToRally(oNPC); return; } }