PDA

View Full Version : Bind Wound Fix 70%


therealjjj77
07-02-2006, 01:47 AM
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;
}

fathernitwit
07-04-2006, 03:24 AM
unified diff please.

therealjjj77
07-04-2006, 05:10 AM
unified diff please.

I am a noob and I don't know what a unified diff is or how to make one. =x

aza77
07-04-2006, 06:40 AM
http://en.wikipedia.org/wiki/Diff