default.pl for NPCs without a quest
I've been working lately on making it so that NPCs return items when they've no use for them. Rather than go in deep and rewrite the item & quest handling code, I thought it would be easier if I just had a default quest file that NPCs used when they don't have an existing quest file. This allows me to leave the current quest files completely alone, but still make changes to NPC item handling.
This is what I have so far (and it works very well, except for the exceptions noted below). Change zone\embparser.cpp adding the red lines below: Code:
//if there is no file for the NPC's ID or name, Code:
sub EVENT_ITEM { So, I'd like to code the exceptions but before I spend a ton of time on this, can anyone think of other times when an NPC rejecting an item would be bad? |
a) can pets be somehow separated from rest of npcs?
like check "if pet" ? b) a rule "npc automaticly return items" true/flase btw- curently i don't mind my players giving items to any npc for any reason, with one BIG expection - when these bastards (my players :cool: ) give npc a no drop item as means of passing it to another player/alt :-x |
I'm confused? What does this do actually? default.pl already works, both by zone, and server wide. (It goes in the root directory of quests, not templates. Never made sense to me, but it works)
Though, great idea about setting it so that default NPCs auto return items. |
Quote:
|
This would be a great idea, I know there was a default.pl didn't know it worked - and I can't find one now, does anybody see one in their directory?
if so, can they post ? |
This will do it ;) Though, it does not work for bots. I'll have to go through the bot code and see if I can use another object to identify if the NPC is a bot or not.
Code:
sub EVENT_ITEM { Code:
sub EVENT_SAY { |
Great script CD. I don't use the bots on my server, so I'm afraid I'll be no help there...but on the plugin::return_items issue, I started writing a crawler script that would update these. Still needs quite a bit of testing, but I've been swamped at work lately so it may be some time before I can finish it up.
|
All times are GMT -4. The time now is 02:42 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.