pet dies when caster becomes invisible
I want to modify pets in a variety of ways..to make them function as they originally did on live.
I am new to making custom changes, so the methods I use are probably not correct at all. #1. Pets die when their caster becomes invisible/hidden. What is the correct way to go about this? I tried using SetPet(0) in attack.cpp, but no change.. probably because I don't know what I'm doing :D #2. Pets die when their owner zones I received errors when trying to use SetPet in client.cpp #3. When an npc dies, its pet remains and fights until death. I wasn't entirely sure where to find this. Only thing I found was in attack.cpp. ^ Results : Same as above Any knowledge about how to make this work will be appreciated by the npcs of norrath. |
There is obviously a million ways to do this but if you have your heart on doing it while attacks are processing...
Scenario #1 Code:
if(this->CastToMob()->HasPet() && this->CastToMob()->IsInvisible()) |
Oh.. my heart is not set in one direction or the other.. :)
I tried a few times to do this on my own and figured an example would help a lot. I will be satisfied with it working at all. Thanks Yeormom, your example helps me see how this works/what methods I can use. |
You should technically do more checking when you implement something like that as well, like making sure GetPet() actually returns a pet and isn't null before you kill it for example.
|
in client_process.cpp at line 542 Below DoStaminaUpdate();
Code:
Mob* myPet = this->GetPet(); Namely it's the if(myPet && invisible == true && amClient) //Null: pet goes away on Invisibility this->SetPet(0); lines. I didn't test this. I just noticed it while I was doing an old revision to newest that it had this code. |
Or just don't change it. It was a stupid thing anyways.
|
Quote:
Thanks your post Shin Noir.. one of my developers made something for me a while ago, similiar to this: defined a custom method for DitchPet and then for spell effects each invis Code:
if( IsClient() && GetPet() ) |
Not really. Anyways, a better way address your concern is to break invis. if the persons pet attacks.
Reason I never like this was it heavily penalized pet classes while non-pet classes suffered no ill from being invis. and all the advantages. |
Everything is currently working as I hoped it would..
-pets die upon invis, or hide -pets die when you zone.. -all pre-fixed duration invisibilities fade randomly -npc pets remain and fight after their master is slain -PC pets operate based on their owner's faction, so mobs will attack them Quote:
I played a magician from kunark - planes of power.. and I have to say, it was easy mode after a while.. running around with queued pets, while invisible.. http://classicbetatest.guildlaunch.com |
Quote:
|
Quote:
As far as invisibilities go, I'll try and get that together.. it isn't complete yet though, as it currently affects all invisibilities, including the fixed duration I believe. |
Too cool, thank you =) I just know there are so many classic projects, and if there's one less thing to code manually between them, then they all benefit. Much appreciated!
|
All times are GMT -4. The time now is 10:07 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.