|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum) |
 |
|
 |

06-21-2006, 01:56 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
Unified Diff
Code:
--- C:\Code\EQEmu800\zone\attack.cpp Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\attack.cpp Sun Jun 18 10:30:31 2006
@@ -1727,10 +1727,14 @@
if (other == myowner)
return;
- if (owner) { // Other has a pet, add him and it
+ if (owner) { // Other is a pet, add him and it
hate_list.Add(other, hate, 0, bFrenzy, !iBuffTic);
+ // EverHood 6/12/06
+ // Can't add a feigned owner to hate list
+ if(!owner->CastToClient()->GetFeigned()){
hate_list.Add(owner, 1, damage, false, !iBuffTic);
}
+ }
else { // Other has no pet, add other
hate_list.Add(other, hate, damage, false, !iBuffTic);
}
@@ -1741,8 +1745,9 @@
myowner->hate_list.Add(other, 1, 0, bFrenzy);
}
if (!wasengaged) {
- if(IsNPC() && other->CastToClient())
+ if(IsNPC() && other->CastToClient()){
parse->Event(EVENT_AGGRO, this->GetNPCTypeID(), 0, CastToNPC(), other);
+ }
AI_Event_Engaged(other, iYellForHelp);
adverrorinfo = 8293;
}
@@ -2068,9 +2073,21 @@
else
hate = damage; // normal aggro for everything else
- mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, attacker->GetName());
- // now add done damage to the hate list
+ // EverHood 6/12/06
+ if(attacker->IsClient()){
+ // check if attacker is feigned
+ if(attacker->CastToClient()->GetFeigned()){
+ hate = -1; // no hate for feigned attackers
+ }
+ }
+
+ if(hate != -1){
+ // attacker generated some hate so
+ // add damage done by attacker to the hate list
+ // mlog(COMBAT__HITS, "Generating %d hate towards %s", hate, attacker->GetName());
AddToHateList(attacker, hate, damage, true, false, iBuffTic);
+ }
+
}
if(damage > 0) {
--- C:\Code\EQEmu800\zone\client.cpp Fri May 12 19:35:58 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.cpp Sun Jun 18 03:11:40 2006
@@ -143,6 +143,8 @@
ooc_timer(1000),
shield_timer(500),
fishing_timer(8000),
+ // EverHood 6/16/06
+ forget_timer(120000),
#ifdef REVERSE_AGGRO
scanarea_timer(AIClientScanarea_delay),
#endif
@@ -1763,13 +1765,25 @@
}
void Client::SetFeigned(bool in_feigned) {
+ feigned=in_feigned;
if (in_feigned)
{
+// EverHood 6/12/06
+// Live doesn't kill pets when owner feigns anymore
+// Hasn't since mobs quit agroing pets.
+// If you're worried necros will Feign and let pet solo
+// mobs turn this on in Features.h.
+// *Note: If a necro pet can solo an xp bearing mob while owner is FD
+// that mob needs it's stats bumped.
+#ifdef KILL_PET_ON_FEIGN
SetPet(0);
+#endif
SetHorseId(0);
entity_list.ClearFeignAggro(this);
+ forget_timer.Start(120000);
+ }else{
+ forget_timer.Disable();
}
- feigned=in_feigned;
}
void Client::LogMerchant(Client* player, Mob* merchant, Merchant_Sell_Struct* mp, const Item_Struct* item, bool buying)
--- C:\Code\EQEmu800\zone\client.h Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.h Mon Jun 19 14:52:37 2006
@@ -512,7 +512,11 @@
inline void SetBecomeNPCLevel(int8 level) { npclevel = level; }
bool LootToStack(uint32 itemid);
void SetFeigned(bool in_feigned);
- inline bool GetFeigned() { return(GetAppearance() != eaDead ? false : feigned); }
+ // EverHood 6/16/06
+ /// this cures timing issues cuz dead animation isn't done but server side feigning is?
+ inline bool GetFeigned() {return(feigned); }
+
+ //inline bool GetFeigned() { return(GetAppearance() != eaDead ? false : feigned); }
EQStreamInterface* Connection() { return eqs; }
#ifdef PACKET_PROFILER
void DumpPacketProfile() { if(eqs) eqs->DumpPacketProfile(); }
@@ -768,11 +772,13 @@
Timer ooc_timer;
Timer shield_timer;
Timer fishing_timer;
+ // EverHood 6/16/06
+ // our 2 min everybody forgets you timer
+ Timer forget_timer;
#ifdef REVERSE_AGGRO
Timer scanarea_timer;
#endif
Timer tribute_timer;
-
#ifdef PACKET_UPDATE_MANAGER
UpdateManager update_manager;
#endif
--- C:\Code\EQEmu800\zone\client_process.cpp Mon Apr 17 06:59:14 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client_process.cpp Sun Jun 18 02:07:29 2006
@@ -534,8 +534,11 @@
//At this point, we are still connected, everything important has taken
//place, now check to see if anybody wants to aggro us.
if(ret && scanarea_timer.Check()) {
+ // Everhood 6/15/06 - only check prox agro if we are not feigned
+ if(!feigned){
entity_list.CheckClientAggro(this);
}
+ }
#endif
if (client_state != CLIENT_LINKDEAD && (client_state == CLIENT_ERROR || client_state == DISCONNECTED || client_state == CLIENT_KICKED || !eqs->CheckState(ESTABLISHED))) {
@@ -576,7 +579,12 @@
}
OnDisconnect(true);
}
-
+ // EverHood Feign Death 2 minutes and zone forgets you
+ if (forget_timer.Check()) {
+ forget_timer.Disable();
+ entity_list.ClearZoneFeignAggro(this);
+ Message(0,"Your enemies have forgotten your aggressions.");
+ }
return ret;
}
--- C:\Code\EQEmu800\zone\entity.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.cpp Sun Jun 18 09:54:40 2006
@@ -2475,8 +2475,24 @@
{
iterator.GetData()->CastToNPC()->RemoveFromHateList(targ);
if (iterator.GetData()->CastToMob()->GetLevel() >= 35)
- iterator.GetData()->CastToNPC()->SetFeignMemory(targ->CastToMob()->GetName());
+ // EverHood 6/14/06
+ // the mob that hated us is 35+ so 3 outta 5 chance
+ // he adds us to its feign memory
+ if(((float)rand()/RAND_MAX)*100 < 40){
+ iterator.GetData()->CastToNPC()->AddFeignMemory(targ->CastToClient());
}
+ }
+ iterator.Advance();
+ }
+}
+// EverHood 6/17/06
+void EntityList::ClearZoneFeignAggro(Client* targ)
+{
+ LinkedListIterator<NPC*> iterator(npc_list);
+ iterator.Reset();
+ while(iterator.MoreElements())
+ {
+ iterator.GetData()->RemoveFromFeignMemory(targ);
iterator.Advance();
}
}
--- C:\Code\EQEmu800\zone\entity.h Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.h Sun Jun 18 02:07:29 2006
@@ -251,6 +251,8 @@
void Process();
void ClearFeignAggro(Mob* targ);
+ // Everhood 6/17/06
+ void ClearZoneFeignAggro(Client* targ);
bool Fighting(Mob* targ);
void RemoveFromHateLists(Mob* mob, bool settoone = false);
--- C:\Code\EQEmu800\zone\MobAI.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\MobAI.cpp Sun Jun 18 13:33:22 2006
@@ -942,6 +942,10 @@
SetAppearance(eaStanding, false);
SetMoving(false);
SendPosition();
+ // EverHood - wipe feign memory since we reached our first waypoint
+ if(cur_wp==1){
+ ClearFeignMemory();
+ }
}
else
{ // not at waypoint yet, so keep moving
@@ -969,6 +973,8 @@
{
if(moved) {
mlog(AI__WAYPOINTS, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z);
+ // EverHood 6/18/06
+ ClearFeignMemory();
moved=false;
SetMoving(false);
SendPosition();
|
 |
|
 |
 |
|
 |

06-21-2006, 01:57 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
Unified Diff (Cont)
Code:
--- C:\Code\EQEmu800\zone\npc.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\npc.cpp Mon Jun 19 14:52:37 2006
@@ -481,30 +481,22 @@
if (IsStunned()||IsMezzed())
return true;
- //Feign Death Memory
- if (forget_timer.Check() && strstr(GetFeignMemory(),"0") == NULL) {
- Client* remember_client = entity_list.GetClientByName(GetFeignMemory());
- if (remember_client != 0)
+ // EverHood - 6/14/06
+ // Improved Feign Death Memory
+ if (forget_timer.Check()) {
+ LinkedListIterator<const char*> iterator(feign_memory_list);
+ iterator.Reset();
+ while(iterator.MoreElements())
{
+ Client* remember_client = entity_list.GetClientByName(iterator.GetData());
if (!remember_client->CastToClient()->GetFeigned())
{
AddToHateList(remember_client,1);
- SetFeignMemory("0");
- forgetchance = 0;
+ iterator.RemoveCurrent();
+ // Personal humor
+ Emote("realizes %s wasn't really dead",remember_client->GetName());
}
- else if (rand()%100 <= forgetchance)
- {
- SetFeignMemory("0");
- forgetchance = 0;
- }
- else
- {
- forgetchance += 1;
- }
- }
- else
- {
- SetFeignMemory("0");
+ iterator.Advance();
}
}
@@ -519,6 +511,32 @@
return true;
}
+ // EverHood 6/14/06 - FD memory
+ void NPC::AddFeignMemory(Client* attacker) {
+ feign_memory_list.Insert(attacker->CastToMob()->GetName());
+ Emote("is suspicious of %ss unexpected death.",attacker->GetName());
+ }
+ void NPC::RemoveFromFeignMemory(Client* attacker){
+ LinkedListIterator<const char*> iterator(feign_memory_list);
+ iterator.Reset();
+ while(iterator.MoreElements())
+ {
+ if(iterator.GetData() == attacker->GetName()){
+ // Leaving this debug in is kinda interesting...
+ this->CastToMob()->Emote("loses interest in %s.",attacker->GetName());
+ iterator.RemoveCurrent();
+ }
+ iterator.Advance();
+ }
+ }
+ void NPC::ClearFeignMemory(){
+ if(feign_memory_list.Count()>0){
+ feign_memory_list.Clear();
+ // Leaving this debug in is kinda interesting...
+ this->CastToMob()->Emote("is no longer suspicious of the dead.");
+ }
+ }
+
int32 NPC::CountLoot() {
return(itemlist.size());
}
--- C:\Code\EQEmu800\zone\npc.h Sun Mar 19 20:04:48 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\npc.h Sun Jun 18 01:55:57 2006
@@ -161,7 +161,15 @@
bool IsOnHatelist(Mob*p) { return hate_list.IsOnHateList(p);}
void SetNPCFactionID(sint32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
- void SetFeignMemory(const char* num) {feign_memory = num;}
+ // EverHood 6/14/06
+ // Mobs need to be able to remember more than one feigned attacker
+ void AddFeignMemory(Client* attacker);
+ void RemoveFromFeignMemory(Client* attacker);
+ void ClearFeignMemory();
+
+ void SetFeignMemory(const char* num) {
+ feign_memory = num;
+ }
inline const char* GetFeignMemory() { return feign_memory; }
@@ -251,7 +259,11 @@
int16 max_dmg;
int16 min_dmg;
+ // EverHood 6/14/06
+ LinkedList<const char*> feign_memory_list;
+
const char* feign_memory;
+
int8 forgetchance;
//pet crap:
|
 |
|
 |

06-21-2006, 02:01 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
Above are the diffs for the Feign Death changes. I just resubscribed to live to do testing on the issue of "can snared mobs walk". I will be testing several mobs in several zones and will post my results. Should we start a seperate thread for this debate since it's not covered by the proposed fixes listed in this one? (The FD fixes in this thread do not effect movement speed in any way)
I used WinMerge for the first time to generate the unified diff so if I did something wrong , let me know.
|
 |
|
 |

06-23-2006, 01:46 PM
|
Developer
|
|
Join Date: Jul 2004
Posts: 773
|
|
hey,
diffs look good.
A few comments on the code:
- where you do if(!owner->CastToClient()->GetFeigned()){, you need to be sure that owner is a client first, use if(owner->IsClient() && !owner->Cast....
- make the 120000 value part of the timer duration enum in features.h
- you should check feigned before you call scanarea_timer.Check... so put the check between 'ret and 'scanarea_timer.Check()', also call GetFeigned instead of using `feigned` directly.
- Please do not use the LinkedList data structure, we are doing everything we can to get rid of that, use the STL vector or list.. further, never store string pointers in a data structure like that unless you can garuntee the existence of that pointer until the list is cleared (which you cannot in this case). Use a STL string object in the future... BUT you should not be storing the character's name in the list anyhow, its use their ->CharacterID() and then use GetClientByCharID
- Do not use rand()/RAND_MAX, use MakeRandomInt/Float.
- Do not use CastToMob() unless you truely have a pointer to an Entity object (basically nowhere)... everything else is already derived from a Mob, and does not require a cast.
- Your use of CastToNPC() in ClearFeignAggro is unnescecary, your iterator is already an NPC *... casting is bad, avoid at all costs.
- In ClearFeignAggro, you need to either check to see if the object is a Client object before calling CastToClient for AddFeignMemory, or you need to make ClearFeignAggro take a Client *, and have its caller check it.
- please remove depricated functions, in particular SetFeignMemory and the feign_memory member variable)
- Please only send emotes/messages to the client when they match what live sends, if you add other things for debugging, please use the _log facility instead (use #logs to get messages in game)
|
 |
|
 |

06-23-2006, 02:56 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
I'll work on these changes over the weekend and see how far I can get. Using the STL stuff will be something new to learn but the rest of it seems straightforward. Thanks for the feedback on my rusty c skills
Will post a new diff when I have another draft ready.
|
 |
|
 |

06-25-2006, 05:55 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
Latest Diff
Here is the latest diffs after making the recommended changes.
Code:
--- C:\Code\EQEmu800\zone\attack.cpp Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\attack.cpp Sun Jun 25 22:25:28 2006
@@ -1727,10 +1727,18 @@
if (other == myowner)
return;
- if (owner) { // Other has a pet, add him and it
+ if (owner) { // Other is a pet, add him and it
hate_list.Add(other, hate, 0, bFrenzy, !iBuffTic);
+ // EverHood 6/12/06
+ // Can't add a feigned owner to hate list
+ if(owner->IsClient()){
+ if(!owner->CastToClient()->GetFeigned()){
hate_list.Add(owner, 1, damage, false, !iBuffTic);
}
+ }else{
+ hate_list.Add(owner, 1, damage, false, !iBuffTic);
+ }
+ }
else { // Other has no pet, add other
hate_list.Add(other, hate, damage, false, !iBuffTic);
}
@@ -2068,9 +2077,21 @@
else
hate = damage; // normal aggro for everything else
- mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, attacker->GetName());
- // now add done damage to the hate list
+ // EverHood 6/12/06
+ if(attacker->IsClient()){
+ // check if attacker is feigned
+ if(attacker->CastToClient()->GetFeigned()){
+ hate = -1; // no hate for feigned attackers
+ }
+ }
+
+ if(hate != -1){
+ // attacker generated some hate so
+ // add damage done by attacker to the hate list
+ // mlog(COMBAT__HITS, "Generating %d hate towards %s", hate, attacker->GetName());
AddToHateList(attacker, hate, damage, true, false, iBuffTic);
+ }
+
}
if(damage > 0) {
--- C:\Code\EQEmu800\zone\client.cpp Fri May 12 19:35:58 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.cpp Sun Jun 25 17:55:21 2006
@@ -143,6 +143,8 @@
ooc_timer(1000),
shield_timer(500),
fishing_timer(8000),
+ // EverHood 6/16/06
+ forget_timer(0),
#ifdef REVERSE_AGGRO
scanarea_timer(AIClientScanarea_delay),
#endif
@@ -1763,13 +1765,25 @@
}
void Client::SetFeigned(bool in_feigned) {
+ feigned=in_feigned;
if (in_feigned)
{
+// EverHood 6/12/06
+// Live doesn't kill pets when owner feigns anymore
+// Hasn't since mobs quit agroing pets.
+// If you're worried necros will Feign and let pet solo
+// mobs turn this on in Features.h.
+// *Note: If a necro pet can solo an xp bearing mob while owner is FD
+// that mob needs it's stats bumped.
+#ifdef KILL_PET_ON_FEIGN
SetPet(0);
+#endif
SetHorseId(0);
entity_list.ClearFeignAggro(this);
+ forget_timer.Start(FeignMemoryDuration);
+ }else{
+ forget_timer.Disable();
}
- feigned=in_feigned;
}
void Client::LogMerchant(Client* player, Mob* merchant, Merchant_Sell_Struct* mp, const Item_Struct* item, bool buying)
--- C:\Code\EQEmu800\zone\client.h Wed Jun 07 18:29:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client.h Sun Jun 25 22:29:31 2006
@@ -512,7 +512,9 @@
inline void SetBecomeNPCLevel(int8 level) { npclevel = level; }
bool LootToStack(uint32 itemid);
void SetFeigned(bool in_feigned);
- inline bool GetFeigned() { return(GetAppearance() != eaDead ? false : feigned); }
+ // EverHood 6/16/06
+ /// this cures timing issues cuz dead animation isn't done but server side feigning is?
+ inline bool GetFeigned() {return(feigned); }
EQStreamInterface* Connection() { return eqs; }
#ifdef PACKET_PROFILER
void DumpPacketProfile() { if(eqs) eqs->DumpPacketProfile(); }
@@ -768,6 +770,9 @@
Timer ooc_timer;
Timer shield_timer;
Timer fishing_timer;
+ // EverHood 6/16/06
+ // our 2 min everybody forgets you timer
+ Timer forget_timer;
#ifdef REVERSE_AGGRO
Timer scanarea_timer;
#endif
--- C:\Code\EQEmu800\zone\client_process.cpp Mon Apr 17 06:59:14 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\client_process.cpp Sun Jun 25 01:29:00 2006
@@ -533,7 +533,8 @@
#ifdef REVERSE_AGGRO
//At this point, we are still connected, everything important has taken
//place, now check to see if anybody wants to aggro us.
- if(ret && scanarea_timer.Check()) {
+ // Everhood 6/15/06 - only if client is not feigned
+ if(ret && !GetFeigned() && scanarea_timer.Check()) {
entity_list.CheckClientAggro(this);
}
#endif
@@ -576,7 +577,12 @@
}
OnDisconnect(true);
}
-
+ // EverHood Feign Death 2 minutes and zone forgets you
+ if (forget_timer.Check()) {
+ forget_timer.Disable();
+ entity_list.ClearZoneFeignAggro(this);
+ Message(0,"Your enemies have forgotten you!");
+ }
return ret;
}
--- C:\Code\EQEmu800\zone\entity.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.cpp Sun Jun 25 21:28:04 2006
@@ -2471,12 +2471,31 @@
iterator.Reset();
while(iterator.MoreElements())
{
- if (iterator.GetData()->CastToNPC()->CheckAggro(targ))
+ if (iterator.GetData()->CheckAggro(targ))
{
- iterator.GetData()->CastToNPC()->RemoveFromHateList(targ);
- if (iterator.GetData()->CastToMob()->GetLevel() >= 35)
- iterator.GetData()->CastToNPC()->SetFeignMemory(targ->CastToMob()->GetName());
+ iterator.GetData()->RemoveFromHateList(targ);
+ // EverHood 6/24/06
+ // For client targets if the mob that hated us is 35+
+ // there is a 3 outta 5 chance he adds us to feign memory
+ if(targ->IsClient()){
+ if (iterator.GetData()->GetLevel() >= 35){
+ if(MakeRandomInt(1,100)<=60){
+ iterator.GetData()->AddFeignMemory(targ->CastToClient());
}
+ }
+ }
+ }
+ iterator.Advance();
+ }
+}
+// EverHood 6/17/06
+void EntityList::ClearZoneFeignAggro(Client* targ)
+{
+ LinkedListIterator<NPC*> iterator(npc_list);
+ iterator.Reset();
+ while(iterator.MoreElements())
+ {
+ iterator.GetData()->RemoveFromFeignMemory(targ);
iterator.Advance();
}
}
--- C:\Code\EQEmu800\zone\entity.h Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\entity.h Sun Jun 18 02:07:29 2006
@@ -251,6 +251,8 @@
void Process();
void ClearFeignAggro(Mob* targ);
+ // Everhood 6/17/06
+ void ClearZoneFeignAggro(Client* targ);
bool Fighting(Mob* targ);
void RemoveFromHateLists(Mob* mob, bool settoone = false);
--- C:\Code\EQEmu800\zone\features.h Sat Mar 18 21:09:26 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\features.h Sun Jun 25 22:35:20 2006
@@ -207,7 +207,8 @@
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
ClientProximity_interval = 1000,
Tribute_duration = 600000,
- ZoneTimerResolution = 3 //sleep time between zone main loop runs (milliseconds)
+ ZoneTimerResolution = 3, //sleep time between zone main loop runs (milliseconds)
+ FeignMemoryDuration = 120000 // EverHood - Duration player must feign death to clear zonewide agro.
};
enum { //some random constants
@@ -262,7 +263,7 @@
#define MIN_FACTION -1500
//The Level Cap:
-#define LEVEL_CAP 65 //hard cap is 127
+#define LEVEL_CAP 70 //hard cap is 127
//the square of the maximum range at whihc you could possibly use NPC services (shop, tribute, etc)
#define USE_NPC_RANGE2 200*200 //arbitrary right now
--- C:\Code\EQEmu800\zone\MobAI.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\MobAI.cpp Sun Jun 25 21:55:28 2006
@@ -938,16 +938,30 @@
if (cur_wp_x == GetX() && cur_wp_y == GetY())
{ // are we there yet? then stop
mlog(AI__WAYPOINTS, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid());
SetWaypointPause();
SetAppearance(eaStanding, false);
SetMoving(false);
SendPosition();
+ // EverHood - wipe feign memory since we reached our first waypoint
+ if(cur_wp==1){
+ ClearFeignMemory();
+ }
}
@@ -969,6 +983,8 @@
{
if(moved) {
mlog(AI__WAYPOINTS, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z);
+ // EverHood 6/18/06
+ ClearFeignMemory();
moved=false;
SetMoving(false);
SendPosition();
|
 |
|
 |
 |
|
 |

06-25-2006, 05:56 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
Diffs (Cont)
Code:
--- C:\Code\EQEmu800\zone\npc.cpp Wed May 31 21:13:32 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\npc.cpp Sun Jun 25 01:29:00 2006
@@ -233,8 +233,6 @@
pet_spell_id = 0;
delaytimer = false;
- feign_memory = "0";
- forgetchance = 0;
attack_event = false;
attack_speed = d->attack_speed;
@@ -481,30 +479,19 @@
if (IsStunned()||IsMezzed())
return true;
- //Feign Death Memory
- if (forget_timer.Check() && strstr(GetFeignMemory(),"0") == NULL) {
- Client* remember_client = entity_list.GetClientByName(GetFeignMemory());
- if (remember_client != 0)
+ // EverHood - 6/14/06
+ // Improved Feign Death Memory
+ if (forget_timer.Check() && !feign_memory_list.empty()) {
+ std::list<int32>::iterator RememberedCharID;
+ for (RememberedCharID=feign_memory_list.begin(); RememberedCharID != feign_memory_list.end(); RememberedCharID++)
+ {
+ Client* remember_client = entity_list.GetClientByCharID(*RememberedCharID);
+ if (!remember_client->GetFeigned())
{
- if (!remember_client->CastToClient()->GetFeigned())
- {
- AddToHateList(remember_client,1);
- SetFeignMemory("0");
- forgetchance = 0;
- }
- else if (rand()%100 <= forgetchance)
- {
- SetFeignMemory("0");
- forgetchance = 0;
- }
- else
- {
- forgetchance += 1;
- }
+ AddToHateList(remember_client->CastToMob(),1);
+ feign_memory_list.remove(*RememberedCharID);
+ break;
}
- else
- {
- SetFeignMemory("0");
}
}
@@ -519,6 +506,22 @@
return true;
}
+ // EverHood 6/14/06 - FD memory
+ void NPC::AddFeignMemory(Client* attacker) {
+ feign_memory_list.push_back(attacker->CharacterID());
+ }
+ void NPC::RemoveFromFeignMemory(Client* attacker){
+ if(!feign_memory_list.empty()){
+ int32 attacker_charid = attacker->CharacterID();
+ feign_memory_list.remove(attacker_charid);
+ }
+ }
+ void NPC::ClearFeignMemory(){
+ if(!feign_memory_list.empty()){
+ feign_memory_list.clear();
+ }
+ }
+
int32 NPC::CountLoot() {
return(itemlist.size());
}
--- C:\Code\EQEmu800\zone\npc.h Sun Mar 19 20:04:48 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\npc.h Sun Jun 25 01:29:00 2006
@@ -161,9 +161,11 @@
bool IsOnHatelist(Mob*p) { return hate_list.IsOnHateList(p);}
void SetNPCFactionID(sint32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
- void SetFeignMemory(const char* num) {feign_memory = num;}
-
- inline const char* GetFeignMemory() { return feign_memory; }
+ // EverHood 6/14/06
+ // Mobs need to be able to remember more than one feigned attacker
+ void AddFeignMemory(Client* attacker);
+ void RemoveFromFeignMemory(Client* attacker);
+ void ClearFeignMemory();
float org_x, org_y, org_z, org_heading;
@@ -251,8 +253,8 @@
int16 max_dmg;
int16 min_dmg;
- const char* feign_memory;
- int8 forgetchance;
+ // EverHood 6/14/06
+ std::list<int32> feign_memory_list;
//pet crap:
int16 pet_spell_id;
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:12 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |