Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2006, 01:47 AM
therealjjj77
Sarnak
 
Join Date: Apr 2006
Location: Dubuque, IA
Posts: 30
Default Bind Wound Fix 70%

On live the max hp for any level to bind wound has been 70% for a while. Here is the change for 7.0.0:

Change client.cpp (do search for "bindwound")

bool Client::BindWound(Mob* bindmob, bool start, bool fail){
EQApplicationPacket* outapp = 0;
if(!fail) {
outapp = new EQApplicationPacket(OP_Bind_Wound, sizeof(BindWound_Struct));
BindWound_Struct* bind_out = (BindWound_Struct*) outapp->pBuffer;
// Start bind
if(!bindwound_timer.Enabled()) {
//make sure we actually have a bandage... and consume it.
sint16 bslot = m_inv.HasItemByUse(ItemTypeBandage, 1, invWhereWorn|invWherePersonal);
if(bslot == SLOT_INVALID) {
bind_out->type = 3;
QueuePacket(outapp);
bind_out->type = 7; //this is the wrong message, dont know the right one.
QueuePacket(outapp);
return(true);
}
DeleteItemInInventory(bslot, 1, true); //do we need client update?

// start complete timer
bindwound_timer.Start(10000);
bindwound_target = bindmob;

// Send client unlock
bind_out->type = 3;
QueuePacket(outapp);
bind_out->type = 0;
// Client Unlocked
if(!bindmob) {
// send "bindmob dead" to client
bind_out->type = 4;
QueuePacket(outapp);
bind_out->type = 0;
bindwound_timer.Disable();
bindwound_target = 0;
}
else {
// send bindmob "stand still"
if(!bindmob->IsAIControlled() && bindmob != this ) {
bind_out->type = 2; // ?
//bind_out->type = 3; // ?
bind_out->to = GetID(); // ?
bindmob->CastToClient()->QueuePacket(outapp);
bind_out->type = 0;
bind_out->to = 0;
}
else if (bindmob->IsAIControlled() && bindmob != this ){
; // Tell IPC to stand still?
}
else {
; // Binding self
}
}
} else {
// finish bind
// disable complete timer
bindwound_timer.Disable();
bindwound_target = 0;
if(!bindmob){
// send "bindmob gone" to client
bind_out->type = 5; // not in zone
QueuePacket(outapp);
bind_out->type = 0;
}

else {
if (bindmob->DistNoRoot(*this) <= 400) {
// send bindmob bind done
if(!bindmob->IsAIControlled() && bindmob != this ) {

}
else if(bindmob->IsAIControlled() && bindmob != this ) {
// Tell IPC to resume??
}
else {
// Binding self
}
// Send client bind done

//this is taken care of on start of bind, not finish now, and is improved
//DeleteItemInInventory(m_inv.HasItem(13009, 1), 1, true);

bind_out->type = 1; // Done
QueuePacket(outapp);
bind_out->type = 0;
CheckIncreaseSkill(BIND_WOUND);

int max_percent = 70 + 10 * GetAA(aaFirstAid);
int max_hp = bindmob->GetMaxHP()*max_percent/100;

// send bindmob new hp's
if (bindmob->GetHP() < bindmob->GetMaxHP() && bindmob->GetHP() <= (max_hp)-1){
// 0.120 per skill point, 0.60 per skill level, minimum 3 max 30
int bindhps = 3;


if (GetSkill(BIND_WOUND) > 200) {
bindhps += GetSkill(BIND_WOUND)*4/10;
} else if (GetSkill(BIND_WOUND) >= 10) {
bindhps += GetSkill(BIND_WOUND)/4;
}

//Implementation of aaMithanielsBinding is a guess (the multiplier)
switch (GetAA(aaBandageWound))
{
case 1:
bindhps = bindhps * (110 + 20*GetAA(aaMithanielsBinding)) / 100;
break;
case 2:
bindhps = bindhps * (125 + 20*GetAA(aaMithanielsBinding)) / 100;
break;
case 3:
bindhps = bindhps * (150 + 20*GetAA(aaMithanielsBinding)) / 100;
break;
}

//if the bind takes them above the max bindable
//cap it at that value. Dont know if live does it this way
//but it makes sense to me.
int chp = bindmob->GetHP() + bindhps;
if(chp > max_hp)
chp = max_hp;

bindmob->SetHP(chp);
bindmob->SendHPUpdate();
}
else {
//I dont have the real, live
Message(15, "You cannot bind wounds above %d%% hitpoints.", max_percent);
if(bindmob->IsClient())
bindmob->CastToClient()->Message(15, "You cannot have your wounds bound above %d%% hitpoints.", max_percent);
// Too many hp message goes here.
}
}
else {
// Send client bind failed
bind_out->type = 6; // They moved
QueuePacket(outapp);
bind_out->type = 0;
}
}
}
}
else if (bindwound_timer.Enabled()) {
// You moved
outapp = new EQApplicationPacket(OP_Bind_Wound, sizeof(BindWound_Struct));
BindWound_Struct* bind_out = (BindWound_Struct*) outapp->pBuffer;
bindwound_timer.Disable();
bindwound_target = 0;
bind_out->type = 7;
QueuePacket(outapp);
bind_out->type = 3;
QueuePacket(outapp);
}
safe_delete(outapp);
return true;
}
Reply With Quote
  #2  
Old 07-04-2006, 03:24 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

unified diff please.
Reply With Quote
  #3  
Old 07-04-2006, 05:10 AM
therealjjj77
Sarnak
 
Join Date: Apr 2006
Location: Dubuque, IA
Posts: 30
Default

Quote:
Originally Posted by fathernitwit
unified diff please.
I am a noob and I don't know what a unified diff is or how to make one. =x
Reply With Quote
  #4  
Old 07-04-2006, 06:40 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

http://en.wikipedia.org/wiki/Diff
__________________
- http://www.eqemu-paradigma.de -
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:59 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3