////////////////////////////////////////////////////////////////////////////// // Real Time Strategy - NWN - Mana Vault - OnEnter //============================================================================ // By Deva Bryson Winblood. 02/28/2003 ////////////////////////////////////////////////////////////////////////////// void main() { object oPC=GetEnteringObject(); string sTeamP=GetName(OBJECT_SELF); int nAdd=0; effect eVFX=EffectVisualEffect(VFX_IMP_HEAD_ELECTRICITY); object oLeader=GetLocalObject(GetModule(),"oTeamLead"+sTeamP); object oItem=GetItemPossessedBy(oPC,"MANA_CRYSTAL_1"); object oOb; int nMana=GetLocalInt(oLeader,"nManaStore"); string sYourTeam=GetLocalString(oPC,"sTeamID"); int nMC=GetLocalInt(oPC,"nManaCaptured"); if (sYourTeam==sTeamP) { // this is your vault if (oItem!=OBJECT_INVALID) { // get value nAdd=1; AssignCommand(oPC,ClearAllActions()); AssignCommand(oPC,ActionPutDownItem(oItem)); if (!GetIsPC(oPC)) { // convert to pool oOb=CreateObject(OBJECT_TYPE_PLACEABLE,"minormanapool",GetLocation(oPC)); DestroyObject(oItem); } // convert to pool nMC++; } else { oItem=GetItemPossessedBy(oPC,"MANA_CRYSTAL_2"); if (oItem!=OBJECT_INVALID) { nAdd=2; AssignCommand(oPC,ClearAllActions()); AssignCommand(oPC,ActionPutDownItem(oItem)); if (!GetIsPC(oPC)) { // convert to pool oOb=CreateObject(OBJECT_TYPE_PLACEABLE,"manapool",GetLocation(oPC)); DestroyObject(oItem); } // convert to pool nMC++; } else { oItem=GetItemPossessedBy(oPC,"MANA_CRYSTAL_5"); if (oItem!=OBJECT_INVALID) { nAdd=5; AssignCommand(oPC,ClearAllActions()); AssignCommand(oPC,ActionPutDownItem(oItem)); if (!GetIsPC(oPC)) { // convert to pool oOb=CreateObject(OBJECT_TYPE_PLACEABLE,"strongmanapool",GetLocation(oPC)); DestroyObject(oItem); } // convert to pool nMC++; } } } // get value if (nAdd>0) { SetLocalInt(GetModule(),"bHasDepositedMana"+sYourTeam,TRUE); ApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX,oPC,1.0); if(oPC!=oLeader) SendMessageToPC(oLeader,IntToString(nAdd)+" mana was added to your vault by "+GetName(oPC)); } SetLocalInt(oPC,"nManaCaptured",nMC); if (GetIsPC(oPC)) SendMessageToPC(oPC,"MANA VAULT currently stores "+IntToString(nMana)+" mana."); } // this is your vault }