So I have a custom function that uses a system (modified NESS) for loot drops...
anyways, for some reason it always returns the first IF statement as true, EVEN when the shout says specifcally the right racial type?? I am completely dumbfounded!! help??! what am I missing?
here is the function called on a creatures OnSpawn
for example, I place a RAT and a OOZE down, on spawn they shout that they are of racial type 8 (RAT) and (29) OOZE
BUT when the shout that states what LOOT table they are grabbing it always grabs the first If statement...the one for humans, which I dont see how it can?? if I comment that entire block out then it just makes TRUE the next one (for orcs, goblins...)
??
----------------------------------------------------------------------
void LootStartMe(object oObject)
{
int iMyRace = GetRacialType(oObject);
int iRandomStore = Random(3)+100; //allow generic store 100,101,102
int iRandomDrop1 = Random(50)+1; //allow generic chance 1-50%
int iRandomDrop2 = Random(25)+1; //allow generic chance 1-25%
int iRandomDrop3 = Random(10)+1; //allow generic chance 1-10%
int iAppearanceType = GetAppearanceType(OBJECT_SELF); // get creature appearance
////////////////////////////////////////////////////////////////////////////////////////
if (iMyRace == 0 || 1 || 4 || 2 || 3 || 5 || 6 || 23)
{ // standard humanoid drops LOOT_100,101,102
SetLocalInt(oObject,"LootTable",iRandomStore);
SetLocalInt(oObject,"LootTable1ItemChance",iRandomDrop1); //generic chance 1-50%
SetLocalInt(oObject,"LootTable2ItemChance",iRandomDrop2); //generic chance 1-25%
SetLocalInt(oObject,"LootTable3ItemChance",iRandomDrop3); //generic chance 1-10%
ActionSpeakString("I am humanoid standard", TALKVOLUME_SHOUT);
}
if (iMyRace == 18 || 12 || 14 || 15 )
{ // Giant and Monsterous Humanoid drops LOOT_211
SetLocalInt(oObject,"LootTable",211);
SetLocalInt(oObject,"LootTable1ItemChance",iRandomDrop1); //generic chance 1-50%
SetLocalInt(oObject,"LootTable2ItemChance",iRandomDrop2); //generic chance 1-25%
SetLocalInt(oObject,"LootTable3ItemChance",iRandomDrop3); //generic chance 1-10%
ActionSpeakString("I am Giant,Orc,Goblin", TALKVOLUME_SHOUT);
}
else if (iMyRace == 11 || 20)
{ // Dragons and Outsider drops LOOT_210
SetLocalInt(oObject,"LootTable",210);
SetLocalInt(oObject,"LootTable1ItemChance",iRandomDrop1); //generic chance 1-50%
SetLocalInt(oObject,"LootTable2ItemChance",iRandomDrop2); //generic chance 1-25%
SetLocalInt(oObject,"LootTable3ItemChance",iRandomDrop3); //generic chance 1-10%
ActionSpeakString("I am Dragon or Demon", TALKVOLUME_SHOUT);
}
else if (iMyRace == 24)
{ // undead drops LOOT_103
SetLocalInt(oObject,"LootTable",103);
SetLocalInt(oObject,"LootTable1ItemChance",15); // 15% chance
SetLocalInt(oObject,"LootTable2ItemChance",10); // 10% chance
SetLocalInt(oObject,"LootTable3ItemChance",5); // 5% chance
ActionSpeakString("I am undead", TALKVOLUME_SHOUT);
}
else if (iMyRace ==
{
if (iAppearanceType == APPEARANCE_TYPE_DOG_WORG || APPEARANCE_TYPE_DOG_DIRE_WOLF || APPEARANCE_TYPE_DOG_WINTER_WOLF || APPEARANCE_TYPE_DOG_WOLF)
{ // wolf pelt drops LOOT_104
SetLocalInt(oObject,"LootTable",104);
SetLocalInt(oObject,"LootTable1ItemChance",50);// 50% chance only
SetLocalInt(oObject,"LootTable2ItemChance",0);
SetLocalInt(oObject,"LootTable3ItemChance",0);
ActionSpeakString("I am a dog", TALKVOLUME_SHOUT);
}
if (iAppearanceType == 12 || 13 || 15 || 204 || 14)
{ // bear pelt drops LOOT_105
SetLocalInt(oObject,"LootTable",105);
SetLocalInt(oObject,"LootTable1ItemChance",50); // 50% chance only
SetLocalInt(oObject,"LootTable2ItemChance",0);
SetLocalInt(oObject,"LootTable3ItemChance",0);
ActionSpeakString("I am a bear", TALKVOLUME_SHOUT);
}
}
else if (iMyRace == 29 || 25 || 9 || 7 || 19 || 17 || 13)
{ // empty drops LOOT_200
ActionSpeakString("I am Ooze or vermin", TALKVOLUME_SHOUT);
/*
SetLocalInt(OBJECT_SELF,"LootTable",200);
SetLocalInt(OBJECT_SELF,"LootTable1ItemChance",0); // 50% chance only
SetLocalInt(OBJECT_SELF,"LootTable2ItemChance",0);
SetLocalInt(OBJECT_SELF,"LootTable3ItemChance",0);
*/
}
else
{
ActionSpeakString("I am NOT DEFINED", TALKVOLUME_SHOUT);
}
}