PDA

View Full Version : Mobs with random wpn and shields


JimB_1958
07-01-2015, 02:18 PM
I been trying something kind of odd. I can't seem to get it to work. Thought maybe there was an easier way.

I want to spawn a mob, then give it random items in both hands.

I tried this: (both in spawn event and in a timer)

$rhand = quest::ChooseRandom(11709,11149,300,10622,11682,11 709,10704);
$NPC->ModifyNPCStat("d_melee_texture1", $rhand);
$lhand = quest::ChooseRandom(1493,10771,110,10873,10515,116 82,11709);
$NPC->ModifyNPCStat("d_melee_texture2", $lhand);

Didnt work.

I don't want to use $npc->AddItem(10100, 1); because I dont want the NPC to actually have anything to loot.

Any ideas?

Uleat
07-01-2015, 02:31 PM
I didn't see "d_melee_texture#" listed in the wiki page reference..though, I didn't check the actual code.

Did you try WearChange(material_slot, texture, color)?

Use values 7 & 8 for primary/secondary texture slots.

JimB_1958
07-01-2015, 02:41 PM
That worked perfectly !!! Thanks Uleat !!

Uleat
07-01-2015, 05:47 PM
It was a lucky guess :P

JimB_1958
07-03-2015, 03:35 PM
Well... I doubt it was "lucky"

This was for a war event where lots of undead spawn and terrorize the zone. they weren't very terrifying with no weapons in hand. Thanks again.


btw, I love your signature. Being sarcastic, I would add a line to it ;P

The bug is not reproducible, so it is likely a hardware or OS problem, or the loose nut behind the keyboard.

Uleat
07-03-2015, 04:10 PM
That signature is basically a crash message that we received one day from travis-ci after I pushed a commit.

I'm known for my lack of successful ports from windows to linux..so, it was only natural to assume that I crashed the service :D

(It was likely an out of memory error..but, who can say for sure)