178 lines
4.6 KiB
Plaintext
178 lines
4.6 KiB
Plaintext
//Script Name: entertown2
|
|
//////////////////////////////////////////
|
|
//Created By: Genisys (Guile)
|
|
//Created On: 5/24/08 UPDATED 9/16/08
|
|
/////////////////////////////////////////
|
|
/*
|
|
This was updated because the new 1.69
|
|
PC Wand came with some awesome changes,
|
|
ALL items now work from this wand, except
|
|
class based items (like the Inventory Tool, CounterRod)
|
|
|
|
Taken from the original POA, created by
|
|
AW_Olorin, modified by me and added
|
|
new content & items to be handed out.
|
|
*/
|
|
////////////////////////////////////////
|
|
|
|
#include "nw_i0_tool"
|
|
|
|
//PROTOTYPE DEFINED
|
|
void KillAssociate(object i_oPC, int i_type)
|
|
{
|
|
object oAssociate = GetAssociate(i_type, i_oPC);
|
|
if(GetIsObjectValid(oAssociate))
|
|
DestroyObject(oAssociate, 0.0f);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
|
|
object oArea = GetArea(OBJECT_SELF);
|
|
|
|
// place here the % chance of rest being interruped excample here 33% chance of rest being interuped
|
|
SetLocalInt(oArea, "nMonChance",0);
|
|
// place here the blueprint refrenfrence tag of the creature you wish to attack them
|
|
// or place the word CUSTOM which will send a 201 event to the area starting your won script
|
|
// here it is a goblin
|
|
SetLocalString(oArea, "sMonster","");
|
|
|
|
object oPC = GetEnteringObject();
|
|
|
|
//Kill all summons and encountered creatures..
|
|
KillAssociate(oPC, ASSOCIATE_TYPE_SUMMONED);
|
|
KillAssociate(oPC, ASSOCIATE_TYPE_DOMINATED);
|
|
|
|
|
|
if (GetIsDM(oPC) || !GetIsPC(oPC))
|
|
{
|
|
return;
|
|
}
|
|
|
|
int x;
|
|
object Item2 = GetFirstItemInInventory (oPC);
|
|
|
|
while (GetIsObjectValid (Item2))
|
|
{
|
|
x = x + 1;
|
|
|
|
//Kill ALL DEATH Tokens
|
|
if(GetTag(Item2)=="death")
|
|
{ DestroyObject(Item2, 0.0f); }
|
|
|
|
///else if(GetTag(Item2)=="chatcommands2")
|
|
///{ DestroyObject(Item2, 0.0f); }
|
|
|
|
Item2 = GetNextItemInInventory (oPC);
|
|
}
|
|
|
|
if (x >= 201)
|
|
{
|
|
ActionWait(0.2);
|
|
location loc = GetLocation(GetWaypointByTag("burdened"));
|
|
AssignCommand(oPC, ActionJumpToLocation(loc));
|
|
return;
|
|
}
|
|
|
|
//After the inventory has been cleansed check to see if the PC has a death token.
|
|
object oDeath = GetItemPossessedBy(oPC, "death");
|
|
object oCom = GetItemPossessedBy(oPC, "chatcommands2");
|
|
|
|
//Classial Items...
|
|
if ((GetLevelByClass(CLASS_TYPE_CLERIC, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_DRUID, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_SORCERER, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_WIZARD, oPC)>0))
|
|
{
|
|
if (GetItemPossessedBy(oPC, "counterrod")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("counterrod", oPC);
|
|
}
|
|
}
|
|
|
|
//They must be a caster to use the item!
|
|
if ((GetLevelByClass(CLASS_TYPE_CLERIC, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_DRUID, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_SORCERER, oPC)>0)||
|
|
(GetLevelByClass(CLASS_TYPE_WIZARD, oPC)>0))
|
|
{
|
|
if (GetItemPossessedBy(oPC, "speedcaster")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("speedcaster", oPC);
|
|
}
|
|
}
|
|
|
|
if(GetLevelByClass(CLASS_TYPE_DRUID, oPC)>0)
|
|
{
|
|
if (GetItemPossessedBy(oPC, "druidtool")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("druidtool", oPC);
|
|
}
|
|
}
|
|
|
|
//If the player does not have anyone of the following items give them one!
|
|
|
|
//The main plot..
|
|
if (GetItemPossessedBy(oPC, "Readme")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("readme", oPC);
|
|
}
|
|
|
|
//Time Crystal
|
|
if (GetItemPossessedBy(oPC, "timecrystal")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("timecrystal", oPC);
|
|
}
|
|
//Time Crystal
|
|
if (GetItemPossessedBy(oPC, "applist")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("applist", oPC);
|
|
}
|
|
|
|
//Kill the Death Token
|
|
if (oDeath!= OBJECT_INVALID)
|
|
{
|
|
DestroyObject(oDeath, 0.0f);
|
|
}
|
|
|
|
if(GetItemPossessedBy(oPC, "namingtool")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("namingtool", oPC);
|
|
}
|
|
if(GetItemPossessedBy(oPC, "portlist")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("portlist", oPC);
|
|
}
|
|
if (oCom == OBJECT_INVALID)
|
|
{
|
|
//Destroy the old chat commands always...
|
|
DestroyObject(GetItemPossessedBy(oPC, "chatcommands"), 0.0f);
|
|
CreateItemOnObject("chatcommands2", oPC);
|
|
}
|
|
if (GetItemPossessedBy(oPC, "fieldtent")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("fieldtent", oPC);
|
|
}
|
|
if (GetItemPossessedBy(oPC, "colorwand")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("colorwand", oPC);
|
|
}
|
|
if (GetItemPossessedBy(oPC, "itemseller")== OBJECT_INVALID)
|
|
{
|
|
CreateItemOnObject("itemseller", oPC);
|
|
}
|
|
|
|
object oBagger = GetItemPossessedBy(oPC, "ibag");
|
|
if (oBagger!=OBJECT_INVALID)
|
|
{
|
|
DestroyObject(oBagger, 0.0f);
|
|
}
|
|
|
|
|
|
|
|
//Show the PC the map of the area
|
|
ExploreAreaForPlayer(GetArea(oPC), oPC, TRUE);
|
|
|
|
//Script end
|
|
}
|