Basic Feign Death code
After around eight hours of struggling with this, it's complete. It's very crude right now, has no "remember" factor and will only work if you're top on aggro.
Next version should have both of these fixed. :) Insert into client_process.cpp: Where the code for standing up is: Code:
if (sa->parameter == 0x64) Code:
case OP_FeignDeath: Insert to bottom of Client:Client (below isgrouped=false) Code:
feigned = 0; Code:
void Client::SetFeigned(int8 in_feigned) { Insert below bool GetPVP() { return pp.pvp; } Code:
void SetFeigned(int8 in_feigned); }; #endif Code:
int8 feigned; Replace if (!sender->IsEngaged()) with: Code:
if (!sender->IsEngaged() && currentmob->CastToClient()>GetFeigned() != 1) And finally, just above if (target->GetID() != this->ownerid && attack_timer->Check()) (line 334) add: Code:
if (hate_list.GetTop()->CastToClient()->GetFeigned() == 1) { |
Version 2.0:
- Fixed a couple crash bugs - Added basic spell breaks feign support - Added basic memory code (NPC's can only remember one person right now, and if it returns to spawn point, memory list is wiped) npc.cpp: At the top of the script, just below extern SPDat_Spell_Struct spells[SPDAT_RECORDS]; add: Code:
int feigntimer = 0; Code:
if (IsEngaged()) { Code:
if (this->GetFeignMemory() != "0") { Code:
feign_memory = "0"; Code:
void Mob::SetFeignMemory(char* in_feign_memory) { Code:
char* feign_memory; Code:
void SetFeignMemory(char* in_feign_memory); Code:
if (this->CastToClient()->GetFeigned()==1) { - Skill gain, success and failure. - All mobs will stop attacking you on success, if you are top of their aggro list. - Mobs will not aggro a feigned person. - Mobs above level 34, if they haven't returned to their spawn point, will remember one feigned person (last person who feigned). Every few seconds they have a chance to forget him. If he stands up while on memory list, they'll reaggro. - Spells will interrupt feign. |
Also, a little todo list:
- Replace getting top aggro with cycling through aggro list. - Support for larger memory lists. - Spell FD with skill checks against abjure. |
Edited version 2.0 post with a couple tweaks and a bug fix.
|
when adding something like this, you complile this and all the other source files together as your zone program right? Bit new to this =)
|
Right, Maniac.
|
Ok i spent like 20 mins adding all the files
to a project to find it wouldn't compile. Is there a certain compiler i need? |
What are you using? Virtual C++?
|
Dev C++ , a free one i found a while back. Open to suggestions for a better one to use =)
|
Well, what are the compilation problems? You should just have to open the zone.dsw and compile.
|
The fact i don't seem to have zone.dsw could be a start =P
|
Redownload the 0.3.1.1 source.
|
just did but only contained server, world, and client .dsw ...sorry to take up so much space with posts hehe =)
|
Well yeah, use server.dsw then, and compile the Zone... paste any errors here.
|
All times are GMT -4. The time now is 08:02 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.