Feign Death Code - Revised
This is a complete code snippet for Feign Death, including aggro clearing, enemy memory, and such.
To initiate, open client_process.cpp, and insert this under the opcodes. Code:
case OP_FeignDeath: Code:
SetFeigned(false); Code:
void SetFeigned(bool in_feigned); Code:
feigned=false; Code:
void Client::SetFeigned(bool in_feigned) { Code:
void SetFeignMemory(const char* num) {feign_memory = num;} Code:
feign_memory = "0"; Code:
if (forget_timer->Check() && strstr(GetFeignMemory(),"0") == NULL) { Code:
void ClearFeignAggro(Mob* targ); Code:
void EntityList::ClearFeignAggro(Mob* targ) Code:
sender->AddToHateList(currentmob,1); Code:
&& !currentmob->CastToClient()->GetFeigned() Insert this into spells.cpp, under SpellEffect: Code:
if (spells[spell_id].goodEffect == 0 && this->IsClient() && this->CastToClient()->GetFeigned()) { Code:
this->CastToClient()->SetFeigned(true); - Easier processing. Having a purely time based forget chance eliminates some of the more comical aspects to VI's FD, and can also be modified per NPC through a database, if some tweaking is done. - You don't have to turn off autoattack for this feign to work (Never understood that anyways). - No feign bug, at all. This feign always works when successfully processed. |
Oh, yeah. This needs to be added to hate_list.cpp:
Code:
bool HateList::IsOnList(Mob* targ) Code:
bool IsOnList(Mob* targ); Code:
bool CheckAggro(Mob* other) {return hate_list.IsOnList(other);} |
Very nice wiz, can't wait to test it out on next release. =)
|
Very clean and good, Wiz :) Thanks for the feature!
|
You kinda missed the whole they only forget after they walk back to spawn point(we dont' do) and then they alwyas forget unless they are above level 35..
|
Actually kath, level 35 is included. Check again.
Also, they CAN forget without walking back to spawn point, the chance is small - I just did it this way, because I personally like this system better. I don't believe in doing everything exactly as VI has. I'll just quote the section: Code:
if (iterator.GetData()->CastToMob()->GetLevel() >= 35) |
Fixed a typo in the code.
But, if you REALLY want a VI clone, here you go: Code:
if (forget_timer->Check() && strcasecmp(GetFeignMemory(),"0") != 0) { |
Hmm, it sure does.. my bad =P
|
All times are GMT -4. The time now is 11:28 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.