Jaysyn904 5e558169a0 Initial Commit
Initial Commit
2025-04-03 11:24:16 -04:00

411 lines
8.6 KiB
Plaintext

void GoodTomb(int nRoll, object oTarget, object oPC)
{
string sTomb;
string ResRef;
object oTombChest = GetObjectByTag("tomb_chest");
object oTombChest2 = GetObjectByTag("tomb_chest2");
object oTombChest3 = GetObjectByTag("tomb_chest3");
object oItem;
int oFlag = 0;
int oFlag2 = 0;
int nDice;
switch(nRoll)
{
case 1: sTomb = "deathwurm"; break;
case 2: sTomb = "deathwurm2"; break;
case 3: sTomb = "balroglord"; break;
case 4: sTomb = "balroglord2"; break;
case 5: sTomb = "darkreaver"; break;
case 6: sTomb = "darkreaver2"; break;
case 7: sTomb = "wardemon"; break;
case 8: sTomb = "wardemon2"; break;
case 9: sTomb = "thevaldar"; break;
case 10: sTomb = "thevaldar2"; break;
case 11: sTomb = "bardheratic"; break;
case 12: sTomb = "bardheratic2"; break;
case 13: sTomb = "kamaji"; break;
case 14: sTomb = "kamaji2"; break;
case 15: sTomb = "mistress"; break;
case 16: sTomb = "mistress2"; break;
case 17: sTomb = "baal1"; break;
case 18: sTomb = "baal2"; break;
case 19: sTomb = "lucifer1"; break;
case 20: sTomb = "lucifer2"; break;
}
// Check player's inventory for the tomb. If its already there, flag it
oItem = GetFirstItemInInventory(oPC);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oPC);
}
// Check special tomb-storage chest #1. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest);
}
// Check special tomb-storage chest #2. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest2);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest2);
}
// Check special tomb-storage chest #3. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest3);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest3);
}
// if the player doesn't have the tomb, and its not in his chests, drop it.
if (oFlag!=1)
{
CreateItemOnObject(sTomb, oTarget);
}
if ((d20()>=15)&&(oFlag2!=1))
{
CreateItemOnObject("phoenix_tome", oTarget);
}
}
void EvilTomb(int nRoll, object oTarget, object oPC)
{
object oTombChest = GetObjectByTag("tomb_chest");
object oTombChest2 = GetObjectByTag("tomb_chest2");
object oTombChest3 = GetObjectByTag("tomb_chest3");
string sTomb;
string ResRef;
object oItem;
int oFlag = 0;
int oFlag2 = 0;
int nDice;
switch(nRoll)
{
case 1: sTomb = "gdeathwurm"; break;
case 2: sTomb = "gdeathwurm2"; break;
case 3: sTomb = "gbalroglord"; break;
case 4: sTomb = "gbalroglord2"; break;
case 5: sTomb = "gdarkreaver"; break;
case 6: sTomb = "gdarkreaver2"; break;
case 7: sTomb = "gwardemon"; break;
case 8: sTomb = "gwardemon2"; break;
case 9: sTomb = "gthevaldar"; break;
case 10: sTomb = "gthevaldar2"; break;
case 11: sTomb = "gbardheratic"; break;
case 12: sTomb = "gbardheratic2"; break;
case 13: sTomb = "gkamaji"; break;
case 14: sTomb = "gkamaji2"; break;
case 15: sTomb = "gmistress"; break;
case 16: sTomb = "gmistress2"; break;
case 17: sTomb = "gbaal"; break;
case 18: sTomb = "gbaal2"; break;
case 19: sTomb = "glucifer1"; break;
case 20: sTomb = "glucifer2"; break;
}
oItem = GetFirstItemInInventory(oPC);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oPC);
}
// Check special tomb-storage chest #1. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest);
}
// Check special tomb-storage chest #2. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest2);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest2);
}
// Check special tomb-storage chest #3. If its already there, flag it.
oItem = GetFirstItemInInventory(oTombChest3);
while (oItem!=OBJECT_INVALID)
{
ResRef = GetResRef(oItem);
if (ResRef==sTomb)
{
oFlag=1;
}
if (ResRef=="phoenix_tome")
{
oFlag2=1;
}
oItem = GetNextItemInInventory(oTombChest3);
}
if (oFlag!=1)
{
CreateItemOnObject(sTomb, oTarget);
}
if ((d20()>=15)&&(oFlag2!=1))
{
CreateItemOnObject("phoenix_tome", oTarget);
}
}
void TombSpawn(object oTarget, object oPC)
{
int oMode = GetLocalInt(GetModule(), "gamemode");
int oDrop;
string oCreature = GetTag(oTarget);
if (oCreature=="dragon1") {oDrop=1;}
if (oCreature=="zep_balrog001") {oDrop=2;}
if (oCreature=="dopple") {oDrop=3;}
if (oCreature=="zep_pitfiend001") {oDrop=4;}
if (oCreature=="zep_halfdrafn001") {oDrop=5;}
if (oCreature=="palewarrior") {oDrop=6;}
if (oCreature=="zep_marilithb001") {oDrop=7;}
if (oCreature=="boss1") {oDrop=8;}
if (oCreature=="lord") {oDrop=9;}
if (oCreature=="lucifer") {oDrop=10;}
switch(oDrop)
{
case 1:
{
if (oMode==1)
{
EvilTomb(d4(), oTarget, oPC);
}
else
{
GoodTomb(d4(), oTarget, oPC);
}
}
break;
case 2:
{
if (oMode==1)
{
EvilTomb((d4()+2), oTarget, oPC);
}
else
{
GoodTomb((d4()+2), oTarget, oPC);
}
}
break;
case 3:
{
if (oMode==1)
{
EvilTomb((d4()+4), oTarget, oPC);
}
else
{
GoodTomb((d4()+4), oTarget, oPC);
}
}
break;
case 4:
{
if (oMode==1)
{
EvilTomb((d4()+6), oTarget, oPC);
}
else
{
GoodTomb((d4()+6), oTarget, oPC);
}
}
break;
case 5:
{
if (oMode==1)
{
EvilTomb((d4()+8), oTarget, oPC);
}
else
{
GoodTomb((d4()+8), oTarget, oPC);
}
}
break;
case 6:
{
if (oMode==1)
{
EvilTomb((d4()+10), oTarget, oPC);
}
else
{
GoodTomb((d4()+10), oTarget, oPC);
}
}
break;
case 7:
{
if (oMode==1)
{
EvilTomb((d2()+14), oTarget, oPC);
}
else
{
GoodTomb((d2()+14), oTarget, oPC);
}
}
break;
case 8:
{
if (oMode==1)
{
EvilTomb((d2()+16), oTarget, oPC);
}
else
{
GoodTomb((d2()+16), oTarget, oPC);
}
}
break;
case 9:
{
if (oMode==1)
{
EvilTomb((d2()+18), oTarget, oPC);
}
else
{
GoodTomb((d2()+18), oTarget, oPC);
}
}
break;
case 10:
{
if (oMode==1)
{
//EvilTomb(d4(), oTarget, oPC);
}
else
{
//GoodTomb(d4(), oTarget, oPC);
}
}
break;
}
}
void CreateGold(object oTarget, int nStackSize)
{
object oPC = GetLastKiller();
object oMod = GetModule();
int iHwar = GetLocalInt(oMod, "hwar_on");
if (iHwar!=1)
{
int oBonus;
int oKbonus;
int oPurse;
string sItemTemplate1 = "nw_it_gold001"; // gold
int oKills = GetLocalInt(oPC, "iKilled");
int oDeaths = GetLocalInt(oPC, "iDied");
int oRankMultiplyer = GetLocalInt(oPC, "status");
oBonus = oRankMultiplyer*200;
oKbonus = (oKills-oDeaths)*50;
oPurse = oBonus+oKbonus;
if (oRankMultiplyer>1)
{
SendMessageToPC(oPC, "Rank Bonus Purse Awarded: "+IntToString(oBonus)+" gold");
GiveGoldToCreature(oPC, oBonus);
}
if (oKills>0)
{
SendMessageToPC(oPC, "Kill Bonus Purse Awarded: "+IntToString(oKbonus)+" gold");
GiveGoldToCreature(oPC, oKbonus);
PlaySound("it_coins");
}
//nStackSize+=(oKills-oDeaths)*50;
//nStackSize+=oRankMultiplyer*200;
CreateItemOnObject(sItemTemplate1, oTarget, nStackSize);
}
}
//void main () {}