^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Script: m1q0_feat ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //:://///////////////////////////////////////////// //:: Weapon Spawn Script for Martial Classes //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Spawns in a magical SPECIFIC weapon suited for that class. Will spawn in either a generic or specific, depending on the value. NOTE: Only works on containers */ //::////////////////////////////////////////////// //:: Created By: Andrew, Brent //:: Created On: February 2002 //::////////////////////////////////////////////// #include "NW_O2_CONINCLUDE" void CreateBastardSword(object oTarget, object oAdventurer) { string sItem = ""; int nHD = GetHitDice(oAdventurer); if (GetRange(1, nHD)) // * 800 { int nRandom = Random(1) + 1; switch (nRandom) { case 1: sItem = "nw_wswbs001"; break; } } else if (GetRange(2, nHD)) // * 200 - 2500 { int nRandom = Random(1) + 1; switch (nRandom) { case 1: sItem = "nw_wswmbs002"; break; } } else if (GetRange(3, nHD)) // * 800 - 10000 { int nRandom = Random(2) + 1; switch (nRandom) { case 1: sItem = "nw_wswmbs002"; break; case 2: sItem = "nw_wswmbs009"; break; } } else if (GetRange(4, nHD)) // * 2500 - 16500 { int nRandom = Random(2) + 1; switch (nRandom) { case 1: sItem = "nw_wswmbs009"; break; case 2: sItem = "nw_wswmbs005"; break; } } else if (GetRange(5, nHD)) // * 8000 - 25000 { int nRandom = Random(3) + 1; switch (nRandom) { case 1: sItem = "nw_wswmbs005"; break; case 2: sItem = "nw_wswmbs010"; break; case 3: sItem = "nw_wswmbs006"; break; } } else if (GetRange(6, nHD)) // * 16000 and up { int nRandom = Random(5) + 1; switch (nRandom) { case 1: sItem = "nw_wswmbs010"; break; case 2: sItem = "nw_wswmbs006"; break; case 3: sItem = "nw_wswmbs007"; break; case 4: sItem = "nw_wswmbs003"; break; case 5: sItem = "nw_wswmbs004"; break; } } if (sItem != "") dbCreateItemOnObject(sItem, oTarget, 1); } void CreateBattleAxe(object oTarget, object oAdventurer) { [..snip..] } [..snip..] //:://///////////////////////////////////////////// //:: Prefers //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Returns true if oAdventurer prefers using this weapon. CRITERIA: They have Weapon Focus nFeatWeaponType: Uses the feat constants to differentiate the weapon types */ //::////////////////////////////////////////////// //:: Created By: Brent //:: Created On: March 2002 //::////////////////////////////////////////////// int Prefers(int nFeatWeaponType, object oAdventurer) { if (GetHasFeat(nFeatWeaponType, oAdventurer) == TRUE) return TRUE; else return FALSE; } void main() { object oLastOpener = GetLastOpener(); object oContainer = OBJECT_SELF; if (GetLocalInt(OBJECT_SELF, "NW_L_OPENONCE") > 0 || GetIsObjectValid(oLastOpener) == FALSE) { return; // * abort treasure if no one opened the container } SetLocalInt(OBJECT_SELF, "NW_L_OPENONCE",1); ShoutDisturbed(); // * CHoose the weapon type to create if (Prefers(FEAT_WEAPON_FOCUS_BASTARD_SWORD, oLastOpener) == TRUE) { CreateBastardSword(oContainer, oLastOpener); } else if (Prefers(FEAT_WEAPON_FOCUS_BATTLE_AXE,oLastOpener)) { CreateBattleAxe(oContainer, oLastOpener); } [..snip..] else { CreateClub(oContainer, oLastOpener); // * create a club if I // somehow end up herei } } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^