fourtylashes Posted December 2, 2012 Share Posted December 2, 2012 (edited) Basically, I'm attempting to implement a script that will overhaul DA:O's itemization such that it uses Diablo's mechanics (items are randomly generated). The main issue I see, is that A) Items are static in the toolset editor.B) There is no event script for "an item dropped" or even "an item is picked up" -- only plot/"training" items are checked. Would anyone happen to know of a good means of detecting when a monster drops a weapon or piece of armor? My goal is to modify that drop, adding attributes to it and renaming it, which I believe I can do through scripts. By the way, this will be my itemization system, psuedo code of the idea: Event: On Item Drop If item == weapon if item == longsword int i = RollRandom(0,100); if (i == 0) ExecuteLegendaryMods(); if (i > 0 && i < 10) ExecuteRareMods(); if (i >= 10 && i < 25) ExecuteUncommonMods(); if (i >= 25 && i < 50) ExecuteCommonMods(); else do nothing So you have a 1 in 100 chance of getting a legendary, 9 in 100 for rare, 15 in 100 for uncommon, 25 in 100 for common and 50 in 100 for no mods added to the item. The ExecuteMods() function will check if the item is already "unique" (has stats on it) and is a valid item to modify. If it does not already possess stats on it, then it executes the following psuedo code int i = RollRandom(0,10); if (i <= 1) ExecuteMageItem();if (i > 1 && i < 4) ExecuteRogueItem();if (i >= 4 && i < 7) ExecuteWarriorDamageItem();if (i >= 7 && i <= 10) ExecuteWarriorTankItem(); So this separate function is basically saying, of every longsword that one finds, regardless of its rarity, some will be mage-oriented, some will be rogue-oriented, some will be damage-warrior-oriented and some will be tank-warrior-oriented. This improves itemization because suddenly, there's a reason to try and use two-handed swords as a mage, to play some kind of hybrid mage role that doesn't use staves. Although finding a legendary mage-sword will be very difficult, I imagine I'll be able to force a few legendary rolls at certain vendors to help diversity. Naturally, long swords have 2 warrior types (damage vs tank) which narrow down the number of mods the item will randomly get, but daggers, since they are rogue-oriented, will have two rogue modpools (probably 'rogue utility' and 'backstab damage'), mages will be the most challenging, I may have to give them a fairly large mod pool. But here is what I'm sort of intending as what an ExecuteMageItem(); function will look like, at least for a legendary mod roll (I imagine the legendary mod function will just be a generic mod function which takes a single integer parameter for number of mods) int i = RollRandom(0,15);int j = RollRandom(0,15);int k = RollRandom(0,15);int l = RollRandom(0,15); while (i == j) rerollwhile (i == k) rerollwhile (i == l) rerollwhile (j == k) rerollwhile (j == l) rerollwhile (k == l) reroll It then does 4 more rolls from specific ranges (probably from 1 to 5 or 6) to determine the strength of the mod rolled. Finally, now that we have 4 unique numbers, the game will add corresponding attributes to the item. I imagine 15 mods is a good number, a mage item function for a longsword will probably contain these mods +Intelligence+Spellpower+Willpower+Spirit% Damage+Cold% Damage+Spirit Resistance+Cold Resistance+Strength+Damage+Mana regen in combat+Spirit Damage (added)+Cold Damage (added)Converts all damage to spirit damageCritical melee chance So it might be possible to get a longsword like this +2 damage+15% cold damage+4 IntelligenceConverts all damage to spirit damage What does everyone think? Any suggestions? Edited December 2, 2012 by fourtylashes Link to comment Share on other sites More sharing options...
LemmingoftheGDA Posted December 2, 2012 Share Posted December 2, 2012 Exceptional. A mod that I've seen add drops to already existing (vanilla) enemies is Quests and Legends. A mod I've seen add enemies and drops specifically by the new enemies is S3 Ravage. The Quest and Legends author may still be active. The very best of luck to you! Link to comment Share on other sites More sharing options...
fourtylashes Posted December 2, 2012 Author Share Posted December 2, 2012 Hmm, after some initial testing, and upon reading this thread http://forums.nexusmods.com/index.php?/topic/193366-item-property-script/page__hl__additemproperty it seems that scripts that effect items are... difficult. I don't know how those two particlar mods do it (Ravage mod doesn't have source for me to look at), but I'm a bit lost at the moment. Link to comment Share on other sites More sharing options...
Recommended Posts