scripting questions: dynamic mob level adjustments, caskets

Post Reply
horizon
Posts: 29
Joined: Wed Sep 24, 2014 10:28 pm

scripting questions: dynamic mob level adjustments, caskets

Post by horizon » Mon May 23, 2016 10:50 am

Hey all! I've gotten back into things lately and have been doing some tinkering, but have run into a couple snags. Might I trouble you all for some insight on a few questions?

First question:
Is there a method for dynamically adjusting the level range of mobs in an area (either on next respawn or instantly) based on a variable like a player level or length of battle?
I dug into the mobentity files looking for functions I might be able to use, and tried SetMLevel(); but had no luck. Would anyone have a suggestion on how to do this via a script? I'm looking to have mobs spawn based on the level of a player when they zone in to an area or after they make a kill, and don't want the permanence that would come with editing the min/max values in the database.

Second Question:
Is anyone familiar with the process behind making treasure caskets spawn? I tried playing around with it a year or so ago in E.Saruta by trying to find the ID for a treasure casket in a given area, then using a random number to determine if it popped on kill or not, but I don't recall ever having success. I'm not looking to emulate the number guessing game part of it, just to have a lootable chest. I believe I tried to use similar methods to what was in limbus at the time but produced nothing but error messages.

Third question:
I attempted to add the script for walahra water the other night and have been unable to get it working. I've added a script for it, checked settings in item_basic and item_usable and I still just get "unable to use item" when using. I then copied all the values from a standard potion to the SQL files and .lua file to rule out coding errors on my end, and same deal. Am I forgetting something simple?

thank you in advance for any help or advice you can spare.

horizon
Posts: 29
Joined: Wed Sep 24, 2014 10:28 pm

Re: scripting questions: dynamic mob level adjustments, cask

Post by horizon » Thu Jun 09, 2016 11:17 am

So I've been playing around with caskets and have had some luck, but in my tinkering I've come up with a couple more questions:

After making a list of all the treasure casket npc id's and tracking down the ones located in East Saruta, I started summoning them at a 20% chance after a mob dies. At first I did this via individual mob lua files, but found I could do it universally in the zone by just piggy backing the function into the end of the mobs.lua files (handles kill counts for the drk job quests with chaosbringer). This works just fine in Saruta, (the only zone I've tested caskets in so far.) but I'd prefer to put it into its own independent scripting module, not to mention this approach causes issues when I try to extend things to places like abyssea.

Looking at the file however, I don't get what it is about mobs.lua file that allows it to globally work without having to be called in specific mob scripts or even the zone scripting. I figure I'll have to just sit down and read some lua documentation, but hopefully someone can give me a headstart/hint.

I've applied things to abyssea la theine using some of the sturdy pyxis npc ids, as well as adding in a random loot table based on retail, but I would really like to emulate retail more closely and use a light counter. I am familiar with how to set and read character variables, but discerning how a mob is killed is something I am unsure about where to start from.

Where would I go digging to find specific parameters I can use? Is it just a matter of digging through the src files? is there a list somewhere like the wiki pages for Mob ID or Augment parameters? Thus far I've just been skimming other scripting files for functions and parameters I need, but I'm curious where more specific ones like "isWeaponSkillKill" in mobs.lua come from.

thanks for any help you can provide guys. Also if anyone has any use for the npc id info I'd be happy to provide them to save someone some time.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: scripting questions: dynamic mob level adjustments, cask

Post by kjLotus » Thu Jun 09, 2016 6:58 pm

mobs.lua is called via luautils explicitly (before the specific script)
as for the abyssea lights, we haven't really thought of how to do that yet (probably a listener, but there isn't one set up yet)

Post Reply