Random Race/Class/Texture/Weapons on spawn
Good afternoon once again,
I am looking to try and add some variance to the way mobs look when they spawn. This is especially true when it comes to humanoid types of NPCs that could easily have variable type of equipment and a diverse race environment. Basically for this particular case I have some Rogues in an encampment. They are all similarly named at the moment so I could use just the one script. I want to be able to have them spawn and randomly choose X race, X class, X prim/ sec weapon graphic, X texture. I know it needs to be an Event_Spawn type script, I just don't know how to format it really. I've looked around the forum for examples I could pick apart and use, but haven't had much luck. I appreciate any help. |
So I kinda worked up something I feel it will/should resemble for a particular instance for me. I just don't know what to put where I placed "???"
Code:
#By: Luccian |
Well thanks for a friend (Jenkos) I was given the idea to look at a plugin he saw, weapon_tools, and kinda pick it apart.
From that I was able to find the weapon 1 and weapon 2 commands I think. Gonna test a bit. |
You might take a look at this plugin for giving random appearances as far as face, hair, etc:
Code:
#Usage: plugin::RandomFeatures(Mob); Code:
plugin::RandomWeapons(10648, 10692, 100, 0, 0, 0, 0); |
I was looking at the plugins, however I am a little embarrassed to say I seemed to fail at properly implementing in/ them in a spawn script. I am also unsure as to how much of a burden it may put on the server we may get to host us eventually.
If I could learn how to do these types of things without the plugin first, to understand why the plugin does what it does (if that makes sense), then I would feel better about using them more frequently because I have the knowledge of its inner working. I did see both plugins earlier in the day, and was looking at how they were constructed. I think I am beginning to see how they are able to randomize everything though. |
I read your thread about the proper usage of both plugins but I'm afraid I don't see how it's supposed to be put in an EVENT_SPAWN format.
I start a timer of 1 sec as you recommended, and once the timer is up it will use both plugins to randomize my poor misunderstood bandits with hearts of gold race/ features as well as equipment. I know you've answered nearly all of my questions up to this point, and I thank you for your helping a newer dev, but would you mind giving me an example of proper use? |
Quote:
http://www.eqemulator.org/forums/showthread.php?t=30637 In the first post is an example snippet, within that timer you can have all of your randomized features be executed: Code:
sub EVENT_SPAWN { The below is an example of the code usage, you could use quest::ChooseRandom inside any of the arguments to randomize certain things. #SpawnDynNPC([race, 0 or "random"=Random Player Race, Texture, Gender); Code:
plugin::SpawnDynNPC(quest::ChooseRandom(1, 2, 3, 4, 5, 6, 128, 130), 3, 0); Code:
#SpawnDynNPC([race, 0 or "random"=Random Player Race, Texture, Gender); |
Super!
Huge help Akkadius! Features, weapon, etc.. all changed, makes those poor bandits seem more like individuals now. Your plugin post is great. I saw how the illusion_tool allowed for race/ gender randomization but i didn't really know how to use it. Your plugin along with tutorial-ish post worked great. I do seem to be having a small issue with the texture selection. No matter what I use it shows them as wearing nothing/ cloth type armor as opposed to leather, chain, plate and whatnot. Here is what I came up with with the help I got here: Code:
sub EVENT_SPAWN |
You can also set a random armor tint by adding something like this after all of your other changes are done:
Code:
#my $Material = plugin::RandomRange(1,3); # Random armor texture |
Quote:
|
Quote:
One final question though regarding this all (at least I hope). Is there a way to choose specific weapons only, as opposed to a ranged using the RandomWeapons plugin? Example being I wanted to use weapon 1,3,11,13,27,and 62 but nothing in between. |
That is what chooserandom does.
quest::ChooseRandom(1,3,11,13,27,62) Edit to clarify: If you do not want to set the weapon yourself but still use the plugin, I would use ChooseRandom and then pass the same result into the plugin instead of a range. |
Quote:
I thought the entry was quest::wearchange(7,(weapon#)), where I could make the weapon number a chooserandom, however I was mistaken. Quote:
|
Is that vBulletin or is there really a space in 10650 weapon?
|
No space, probably just a typo.
|
All times are GMT -4. The time now is 03:50 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.