Dan Loto Posted October 23, 2008 Share Posted October 23, 2008 Greetings. I need a dialog script like the one on Tatooine that the Czerka lady uses to give you the appropriate amount of credits depending on how many gaffi sticks you bring her, but instead of gaffi sticks I want it to be Gamorrean axes. Their resref is g_w_waraxe001 and their tag is G_W_WARAXE001. The reward per axe would be 50 credits. I've already made a working conditional to check if you have at least one axe in your inventory, but I have no clue on how to do the rest. This is for KotOR 1. Thank you for your time Link to comment Share on other sites More sharing options...
Canderis Posted October 23, 2008 Share Posted October 23, 2008 you could do a thing like making a script that makes you be able to say how meny axes you have then use the add money script to give yourself the appropiat ammount. Tell me if im not clear. Link to comment Share on other sites More sharing options...
Dan Loto Posted October 23, 2008 Author Share Posted October 23, 2008 That's basically what I need but I have no idea how to make it. EDIT: I got it to work with the following code...but is there a shorter way to do it? I guess it doesn't really matter though. void main() { object oPC = GetFirstPC(); object oItem = GetItemPossessedBy(GetFirstPC(), "G_W_WARAXE001"); if (GetNumStackedItems(oItem) == 1) GiveGoldToCreature(GetFirstPC(), 100); if (GetNumStackedItems(oItem) == 2) GiveGoldToCreature(GetFirstPC(), 200); if (GetNumStackedItems(oItem) == 3) GiveGoldToCreature(GetFirstPC(), 300); if (GetNumStackedItems(oItem) == 4) GiveGoldToCreature(GetFirstPC(), 400); if (GetNumStackedItems(oItem) == 5) GiveGoldToCreature(GetFirstPC(), 500); if (GetNumStackedItems(oItem) == 6) GiveGoldToCreature(GetFirstPC(), 600); if (GetNumStackedItems(oItem) == 7) GiveGoldToCreature(GetFirstPC(), 700); if (GetNumStackedItems(oItem) == 8) GiveGoldToCreature(GetFirstPC(), 800); if (GetNumStackedItems(oItem) == 9) GiveGoldToCreature(GetFirstPC(), 900); if (GetNumStackedItems(oItem) == 10) GiveGoldToCreature(GetFirstPC(), 1000); if (GetNumStackedItems(oItem) == 11) GiveGoldToCreature(GetFirstPC(), 1100); if (GetNumStackedItems(oItem) == 12) GiveGoldToCreature(GetFirstPC(), 1200); if (GetNumStackedItems(oItem) == 13) GiveGoldToCreature(GetFirstPC(), 1300); if (GetNumStackedItems(oItem) == 14) GiveGoldToCreature(GetFirstPC(), 1400); if (GetNumStackedItems(oItem) == 15) GiveGoldToCreature(GetFirstPC(), 1500); if (GetNumStackedItems(oItem) == 16) GiveGoldToCreature(GetFirstPC(), 1600); if (GetNumStackedItems(oItem) == 17) GiveGoldToCreature(GetFirstPC(), 1700); if (GetNumStackedItems(oItem) == 18) GiveGoldToCreature(GetFirstPC(), 1800); if (GetNumStackedItems(oItem) == 19) GiveGoldToCreature(GetFirstPC(), 1900); if (GetNumStackedItems(oItem) == 20) GiveGoldToCreature(GetFirstPC(), 2000); if (GetNumStackedItems(oItem) == 21) GiveGoldToCreature(GetFirstPC(), 2100); if (GetNumStackedItems(oItem) == 22) GiveGoldToCreature(GetFirstPC(), 2200); if (GetNumStackedItems(oItem) == 23) GiveGoldToCreature(GetFirstPC(), 2300); if (GetNumStackedItems(oItem) == 24) GiveGoldToCreature(GetFirstPC(), 2400); if (GetNumStackedItems(oItem) == 25) GiveGoldToCreature(GetFirstPC(), 2500); if (GetNumStackedItems(oItem) == 26) GiveGoldToCreature(GetFirstPC(), 2600); if (GetNumStackedItems(oItem) == 27) GiveGoldToCreature(GetFirstPC(), 2700); if (GetNumStackedItems(oItem) == 28) GiveGoldToCreature(GetFirstPC(), 2800); if (GetNumStackedItems(oItem) == 29) GiveGoldToCreature(GetFirstPC(), 2900); if (GetNumStackedItems(oItem) == 30) GiveGoldToCreature(GetFirstPC(), 3000); if (GetNumStackedItems(oItem) == 31) GiveGoldToCreature(GetFirstPC(), 3100); if (GetNumStackedItems(oItem) == 32) GiveGoldToCreature(GetFirstPC(), 3200); if (GetNumStackedItems(oItem) == 33) GiveGoldToCreature(GetFirstPC(), 3300); if (GetNumStackedItems(oItem) == 34) GiveGoldToCreature(GetFirstPC(), 3400); if (GetNumStackedItems(oItem) == 35) GiveGoldToCreature(GetFirstPC(), 3500); if (GetNumStackedItems(oItem) == 36) GiveGoldToCreature(GetFirstPC(), 3600); if (GetNumStackedItems(oItem) == 37) GiveGoldToCreature(GetFirstPC(), 3700); if (GetNumStackedItems(oItem) == 38) GiveGoldToCreature(GetFirstPC(), 3800); if (GetNumStackedItems(oItem) == 39) GiveGoldToCreature(GetFirstPC(), 3900); if (GetNumStackedItems(oItem) == 40) GiveGoldToCreature(GetFirstPC(), 4000); if (GetNumStackedItems(oItem) == 41) GiveGoldToCreature(GetFirstPC(), 4100); if (GetNumStackedItems(oItem) == 42) GiveGoldToCreature(GetFirstPC(), 4200); if (GetNumStackedItems(oItem) == 43) GiveGoldToCreature(GetFirstPC(), 4300); if (GetNumStackedItems(oItem) == 44) GiveGoldToCreature(GetFirstPC(), 4400); if (GetNumStackedItems(oItem) == 45) GiveGoldToCreature(GetFirstPC(), 4500); ActionTakeItem(oItem,oPC); Link to comment Share on other sites More sharing options...
Istorian Posted October 24, 2008 Share Posted October 24, 2008 You could try the "while" statement. Like: while(GetNumStackedItems(oItem) > 1) { GiveGoldToCreature(GetFirstPC(), 100); ActionTakeItem(oItem,oPC); } or you could adjust it the way you like it...it's just a simple idea... |I| Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.