generated from Jaysyn/ModuleTemplate
Initial upload
Initial upload
This commit is contained in:
50
_mod/_module/nss/mel_placement.nss
Normal file
50
_mod/_module/nss/mel_placement.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
// mel_placement - Check for Mana elemental placement needs and elevation.
|
||||
void main()
|
||||
{
|
||||
int nN=0;
|
||||
object oMana;
|
||||
object oElem;
|
||||
int nR;
|
||||
string sTag;
|
||||
location lLoc;
|
||||
oMana=GetObjectByTag("StrongManaPool",nN);
|
||||
while(oMana!=OBJECT_INVALID)
|
||||
{ // traverse strong mana pools
|
||||
nR=d100();
|
||||
if (GetStringLength(GetLocalString(GetArea(oMana),"sTeamID"))<3)
|
||||
{ // okay to create
|
||||
if (nR<11)
|
||||
{ // create or upgrade
|
||||
oElem=GetLocalObject(oMana,"oElemental");
|
||||
if (oElem!=OBJECT_INVALID)
|
||||
{ // elemental exists
|
||||
sTag=GetTag(oElem);
|
||||
lLoc=GetLocation(oElem);
|
||||
if (sTag=="MinorManaElemental")
|
||||
{ // upgrade to mana elemental
|
||||
DestroyObject(oElem);
|
||||
oElem=CreateObject(OBJECT_TYPE_CREATURE,"manaelemental",lLoc);
|
||||
SetLocalObject(oMana,"oElemental",oElem);
|
||||
SetLocalObject(oElem,"oManaPool",oMana);
|
||||
} // upgrade to mana elemental
|
||||
else if (sTag=="ManaElemental")
|
||||
{ // upgrade to greater mana elemental
|
||||
DestroyObject(oElem);
|
||||
oElem=CreateObject(OBJECT_TYPE_CREATURE,"greatermanaeleme",lLoc);
|
||||
SetLocalObject(oMana,"oElemental",oElem);
|
||||
SetLocalObject(oElem,"oManaPool",oMana);
|
||||
} // upgrade to greater mana elemental
|
||||
} // elemental exists
|
||||
else
|
||||
{ // create elemental
|
||||
oElem=CreateObject(OBJECT_TYPE_CREATURE,"minormanaelement",GetLocation(oMana));
|
||||
SetLocalObject(oMana,"oElemental",oElem);
|
||||
SetLocalObject(oElem,"oManaPool",oMana);
|
||||
} // create elemental
|
||||
} // create or upgrade
|
||||
} // okay to create
|
||||
nN++;
|
||||
oMana=GetObjectByTag("StrongManaPool",nN);
|
||||
} // traverse strong mana pools
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user