defaultCombat.pl
I want to let all the fighting to stop NPC
Return to full HP Don't know what to do --------------------------------- sub EVENT_SPAWN { Plugin::setnexthpevent(1000); } sub EVENT_COMBAT { if ($combat_state = 1) { $npc->SetHP(9990000); } } ------------------------------- copy---> plugins/defaultCombat.pl ????? HELP!!! and for default.pl ? |
you probably want to edit EVENT_COMBAT in plugins\default-actions.pl
any npc that has EVENT_COMBAT defined in their individual script won't use the default, so you'll have to edit all of them individually. i don't know what you are trying to do with the call to setnexthpevent(), as it is unrelated to what you mentioned wanting to do. $event_combat is set to 0 when an npc leaves combat. using $npc->Heal() should set the npc's health to 100%. |
Quote:
Code:
# Default-actions.pl Help have a look whether this can all ZONE NPC???? |
sorry. i told you wrong. default-actions doesn't need an EVENT_COMBAT sub. you'd just need to edit defaultCombat() to suit your needs. additionally, i think you want to place default.pl directly in the quests directory for plugins\default-actions.pl to be used.
once that is done, this should do what you are wanting: Code:
sub defaultCombat() |
1:this file -default-actions.pl----copy to c:/peq/plugins/ + c:/peq/quests/plugins/
Code:
# Default-actions.pl Code:
|
No, that is not correct. You almost have the plugin correct, but you have extra script lines at the end that will break your plugins:
You should be able to delete this: Code:
return; Next, you would want to call that plugin from your default.pl file. You do not want to put the default.pl directly in your quests folder, you want it in quests/templates/default.pl so it will effect all NPCs that do not already have a script associated with them. Then, in that default.pl file, you would have the following code: Code:
sub EVENT_COMBAT { As mentioned, any NPC that already has a script associated with them in your templates folder or in the quests zone folder for the zone they are in will still need to be modified to have the new plugin added to them. If they already have an EVENT_COMBAT, you would just need to add the plugin line "plugin::defaultCombat();" inside the EVENT_COMBAT. If they don't have an EVENT_COMBAT already, you would need to add the sub EVENT_COMBAT as I posted above for your default.pl file. Since this seems to be a bit confusing to you, there is a MUCH easier way to accomplish what you are wanting to do without even having to worry about scripts at all. You can just edit your rule_values table and set " NPC:OOCRegen" to 100. This will make all NPCs regen to 100% about 6 seconds after it leaves combat. |
yeah, i guess the OOCRegen rule would probably be easier. i keep forgetting to familiarize myself with the various rules... :|
i'm a bit confused about what i'm reading in the source about the loading of npc quest files, however. i come up with this order from reading PerlembParser::LoadScript() in zone/embparser.cpp 1) quests/default.pl 2) quests/<zone>/<npcid>.pl 3) quests/<zone>/<npcname>.pl 4) quests/templates/<npcname>.pl 5) quests/templates/<npcid>.pl 6) quests/<zone>/default.pl 7) quests/templates/default.pl this is what i'm looking at to come to this conclusion: Code:
int PerlembParser::LoadScript(int npcid, const char * zone, Mob* activater) EDIT: i may have just answered my own question. it's only looking for quests/default.pl if no npcid or zoneid are supplied. i haven't looked at where this is called from, but i'm guessing it's probably pretty rare for that to occur. |
It looks like that would only happen if there is no NPCID or zone passed to the function. I am not sure what scenario would cause that to happen, but to my knowledge using a default.pl in the quests folder directly does not work. If it worked like that, it would override any zone specific (or any other) scripts for all NPCs.
I do know it works fine from the templates folder and it loads the default.pl file from there if it doesn't find a more specific script to load first. |
Your methods are not running
I have tested could not operate of pl OOCRegen is OK, others not running! |
It should work, but I am guessing you made more mistakes. If you still need help with it (if OOCRegen isn't good enough for what you want), then please post the plugin and default.pl files you created for this and where you have them saved to.
|
All times are GMT -4. The time now is 10:18 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.