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

08-13-2008, 09:27 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
LOL, I figured it would be something simple like that! I will test it out on my server tonight. My only question is if this takes coin loot into consideration, or only items?
I think you guys are right. This really doesn't have much reason to be set as a rule. I guess I just like to have as many options as possible :P
Thanks Theeper!
|

08-13-2008, 09:40 PM
|
Discordant
|
|
Join Date: May 2004
Posts: 290
|
|
I didn't think about coin, good catch Trev. Use this instead.
Code:
if (itemlist.size() < 1 && in_npc->GetCopper() == 0 && in_npc->GetSilver()== 0 && in_npc->GetGold()== 0 && in_npc->GetPlatinum() == 0)
corpse_decay_timer.SetTimer(5000);
|

08-13-2008, 09:41 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
It doesn't have to be set as a rule but it is; there will be a rule in tonight's build along with some other stuff that's probably not as exciting for some people.
btw there's already a function to tell if the corpse is empty: Corpse::IsEmpty() =p
|

08-13-2008, 09:43 PM
|
Dragon
|
|
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
|
|
Every little bit helps, and all progress is exciting. Thanks as always =)
|

08-13-2008, 10:06 PM
|
Discordant
|
|
Join Date: May 2004
Posts: 290
|
|
Quote:
Originally Posted by KLS
btw there's already a function to tell if the corpse is empty: Corpse::IsEmpty() =p
|
LOL, that's what I get for not looking through the function list very carefully. It seems as though IsEmpty() is only used for the PERL interface right now.
Ignore the above and use this until KLS tells us how it's actually supposed to be done in one line probably :p~
Code:
if (IsEmpty())
corpse_decay_timer.SetTimer(5000);
|

08-13-2008, 10:28 PM
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Well that's actually basically it.
|
 |
|
 |

08-13-2008, 10:39 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Oh, and the main reason I think it would be nice to have as a rule would be to have the option to make corpses poof immediately without even starting a timer. This would probably reduce some of the load on servers after a large AE pull is killed. I know when I have 30ish mobs all die at once, it almost always crashes the zone.
One thing I was thinking is that instead of a rule, it might be nice to have the decay timer be an actual setting in the Zones table similar to canbind, accept the number would be the time in seconds of how long the corpse would last. In most zones, I would like the 5 second timer to be set, because I think it would just be a little weird for corpses to disapear immediately. But there are definitely a couple of zones where I would prefer to have them vanish immediately, mostly because there are often AE groups in those zones and the server needs any help it can get to reduce performance issues from AEing.
|
 |
|
 |
 |
|
 |

08-14-2008, 12:39 AM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
Quote:
Originally Posted by trevius
Doesn't it need the brackets around it like this?
Code:
if (IsEmpty()) {
corpse_decay_timer.SetTimer(5000); }
Or am I still too much of a coding newbie? :P
|
If you have only 1 thing to process in an if, else, etc, statement, you don't need brackets. I know this is true for C++ & Perl, pretty sure it's the same for other languages including PHP.
I know there's another weird function using : and ? for a very simple if/else statement, but I never really paid attention to the syntax.
Quote:
Originally Posted by trevius
Oh, and the main reason I think it would be nice to have as a rule would be to have the option to make corpses poof immediately without even starting a timer. This would probably reduce some of the load on servers after a large AE pull is killed. I know when I have 30ish mobs all die at once, it almost always crashes the zone.
One thing I was thinking is that instead of a rule, it might be nice to have the decay timer be an actual setting in the Zones table similar to canbind, accept the number would be the time in seconds of how long the corpse would last. In most zones, I would like the 5 second timer to be set, because I think it would just be a little weird for corpses to disapear immediately. But there are definitely a couple of zones where I would prefer to have them vanish immediately, mostly because there are often AE groups in those zones and the server needs any help it can get to reduce performance issues from AEing.
|
You could set it up one of many different ways. Unfortunately, I don't know if there's really one "best" way to do it. You could do it on a per-mob basis, per zone basis, per server basis, or a combination of the above. If you really want to add flexibility, I would say all of the above, using mob, zone, then server as the priority using an if, else if, else statement. I'm not sure of the exact code needed, but the idea would be something like this:
Code:
if (mob.empty_corpse_timer != NULL) corpse_decay_timer.SetTimer(mob.empty_corpse_timer)
else if (zone.empty_corpse_timer != NULL) corpse_decay_timer.SetTimer(zone.empty_corpse_timer)
else corpse_decay_timer.SetTimer(RuleI(NPC,EmptyNPCCorpseDecayTimeMS)+1000)
|
 |
|
 |

09-06-2008, 07:12 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I don't know why, but I am running 1129 which should have this code in it (and I see it in the source), but even after I set the rule, it doesn't seem to actually work. Corpses still wait 20 minutes to decay.
Maybe the code for the IsEmpty check needs to go after the normal decay timer checks? I know it was working that way when I tried the code that Theeper posted.
|
 |
|
 |

09-07-2008, 06:52 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Unless the new corpse decay timer is working for people and I just have something set incorrectly (let me know if so), then I am going to try moving it the next time I do a build. I am planning to move it from here (noted in RED):
Code:
Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, int32 in_npctypeid, const NPCType** in_npctypedata, int32 in_decaytime)
// vesuvias - appearence fix
: Mob("Unnamed_Corpse","",0,0,in_npc->GetGender(),in_npc->GetRace(),in_npc->GetClass(),BT_Humanoid//bodytype added
,in_npc->GetDeity(),in_npc->GetLevel(),in_npc->GetNPCTypeID(),in_npc->GetSize(),0,
in_npc->GetHeading(),in_npc->GetX(),in_npc->GetY(),in_npc->GetZ(),0,
in_npc->GetTexture(),in_npc->GetHelmTexture(),
0,0,0,0,0,0,0,0,0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0,0,0,0,0,0,0),
corpse_decay_timer(in_decaytime),
corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)),
corpse_graveyard_timer(0)
{
corpse_graveyard_timer.Disable();
memset(item_tint, 0, sizeof(item_tint));
pIsChanged = false;
p_PlayerCorpse = false;
pLocked = false;
BeingLootedBy = 0xFFFFFFFF;
if (in_itemlist) {
itemlist = *in_itemlist;
in_itemlist->clear();
}
SetCash(in_npc->GetCopper(), in_npc->GetSilver(), in_npc->GetGold(), in_npc->GetPlatinum());
if(IsEmpty())
{
corpse_decay_timer.SetTimer(RuleI(NPC,EmptyNPCCorpseDecayTimeMS)+1000);
}
npctype_id = in_npctypeid;
SetPKItem(0);
charid = 0;
dbid = 0;
p_depop = false;
strcpy(orgname, in_npc->GetName());
strcpy(name, in_npc->GetName());
// Added By Hogie
for(int count = 0; count < 100; count++) {
if ((level >= npcCorpseDecayTimes[count].minlvl) && (level <= npcCorpseDecayTimes[count].maxlvl)) {
corpse_decay_timer.SetTimer(npcCorpseDecayTimes[count].seconds*1000);
break;
}
}
// Added By Hogie -- End
for (int i=0; i<MAX_LOOTERS; i++)
looters[i] = 0;
this->rezzexp = 0;
}
To here:
Code:
Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, int32 in_npctypeid, const NPCType** in_npctypedata, int32 in_decaytime)
// vesuvias - appearence fix
: Mob("Unnamed_Corpse","",0,0,in_npc->GetGender(),in_npc->GetRace(),in_npc->GetClass(),BT_Humanoid//bodytype added
,in_npc->GetDeity(),in_npc->GetLevel(),in_npc->GetNPCTypeID(),in_npc->GetSize(),0,
in_npc->GetHeading(),in_npc->GetX(),in_npc->GetY(),in_npc->GetZ(),0,
in_npc->GetTexture(),in_npc->GetHelmTexture(),
0,0,0,0,0,0,0,0,0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0,0,0,0,0,0,0),
corpse_decay_timer(in_decaytime),
corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)),
corpse_graveyard_timer(0)
{
corpse_graveyard_timer.Disable();
memset(item_tint, 0, sizeof(item_tint));
pIsChanged = false;
p_PlayerCorpse = false;
pLocked = false;
BeingLootedBy = 0xFFFFFFFF;
if (in_itemlist) {
itemlist = *in_itemlist;
in_itemlist->clear();
}
SetCash(in_npc->GetCopper(), in_npc->GetSilver(), in_npc->GetGold(), in_npc->GetPlatinum());
npctype_id = in_npctypeid;
SetPKItem(0);
charid = 0;
dbid = 0;
p_depop = false;
strcpy(orgname, in_npc->GetName());
strcpy(name, in_npc->GetName());
// Added By Hogie
for(int count = 0; count < 100; count++) {
if ((level >= npcCorpseDecayTimes[count].minlvl) && (level <= npcCorpseDecayTimes[count].maxlvl)) {
corpse_decay_timer.SetTimer(npcCorpseDecayTimes[count].seconds*1000);
break;
}
}
// Added By Hogie -- End
if(IsEmpty())
{
corpse_decay_timer.SetTimer(RuleI(NPC,EmptyNPCCorpseDecayTimeMS)+1000);
}
for (int i=0; i<MAX_LOOTERS; i++)
looters[i] = 0;
this->rezzexp = 0;
}
This is my only guess as to why the new decay timer code isn't currently working for me. Especially since it was working perfectly when I added Theeper's code in manually before this was added into the official source. My guess is that the following code that currently comes after the IsEmpty check is still being used even if the corpse is empty and the decay timer is being overwritten to follow these rules instead of using the new IsEmpty rule:
Code:
for(int count = 0; count < 100; count++) {
if ((level >= npcCorpseDecayTimes[count].minlvl) && (level <= npcCorpseDecayTimes[count].maxlvl)) {
corpse_decay_timer.SetTimer(npcCorpseDecayTimes[count].seconds*1000);
break;
}
}
I will try out the move of the IsEmpty check code and see if that resolves the problem.
|
 |
|
 |
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:55 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |