Log in

View Full Version : Couple of Questions about spawning NPC's and Loottables.


Trackye
10-09-2015, 12:44 AM
So I have been trying to figure this out for a few days now and am stumped.

Question 1) How would I go about adding an item to drop globally across the server from any creature that is above level 51?

I cannot seem to see a way to globally add a dropped item ( I did look at the Activating defiant drops post on the forums and got some ideas...but nothing panned out)

So overview Is there a way to make it so any creature over level 51 has a 1% chance to drop this specific item?


Question 2) In attempts to edit the respawn time for some Npc's I run into this issue.

For example.

I want to recreate The Va'Dyn in Akehva and give that NPC a 1 hour spawn time.

To do this atm I have to use #Npctype spawn "Va'dyn Id#"
Then target it and type #npcspawn create.

This works fine aside from that fact that the newly created Va'Dyn has no stats. It copies the HP and nothing else into the Database. Min damage max damage attack resists...

I did edit the respawn times of all creatures with respawns higher than an hour but many creatures do not actively spawn so I have to add them then do it but it messes up their stats when I do this?

Anyone have a better way to do this?


******EDIT*****

Ok it seems like maybe I can use the dbspawn2 command instead and achieve my goals. Would that be correct?

Kingly_Krab
10-09-2015, 01:34 AM
1. You can use global_npc.pl in your global folder to do global NPC drops on NPCs above level 51 like this: sub EVENT_SPAWN {
if ($mlevel > 51) {
if (quest::ChooseRandom(1..100) == 1) {
$npc->AddItem(ID);
}
}
}2. #npcspawn create creates a new NPC which explains why it copies some data. It also adds a spawn entry based on that new NPC. Try using #npcspawn add and modifying the spawn time that way.

jpyou127
10-09-2015, 06:58 AM
Cool stuff Kingly!

Kingly_Krab
10-09-2015, 08:07 AM
Haha, thanks, writing stuff like that is fun. Wrote something on Raid Addicts that gives double loot based on a client have a double loot buff, pretty fun stuff.

jpyou127
10-09-2015, 03:30 PM
Oh! that sounds sweet on the double loot buff!! You folks that can write this stuff amaze me. I am a neeeewwwwwbie when it comes to coding.

=)

Kingly_Krab
10-09-2015, 04:58 PM
Haha, well just message me if you need any assistance with anything.

RussellMatt27
10-14-2015, 02:46 PM
This is perfect! I was looking for something like that rather than having to add the item to each loot drop entry in the DB. Thanks!