From line 2257 find////////////////////////////////////////////////////////////////////////// Ope - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.pastebin.com
blessings = true
blessingOnlyPremium = true
blessingReductionBase = 50
blessingReductionDecrement = 5
eachBlessReduction = 10
uint32_t lostSkillTries, sumSkillTries;
uint32_t lostSkillTries, sumSkillTries;
for(int16_t i = 0; i < 7; ++i) //for each skill
{
lostSkillTries = sumSkillTries = 0;
for(uint32_t c = 11; c <= skills[i][SKILL_LEVEL]; ++c) //sum up all required tries for all skill levels
sumSkillTries += vocation->getReqSkillTries(i, c);
sumSkillTries += skills[i][SKILL_TRIES];
lostSkillTries = (uint32_t)std::ceil(sumSkillTries * ((double)(percent * lossPercent[LOSS_SKILLS]) / 100.));
while(lostSkillTries > skills[i][SKILL_TRIES])
{
lostSkillTries -= skills[i][SKILL_TRIES];
skills[i][SKILL_TRIES] = vocation->getReqSkillTries(i, skills[i][SKILL_LEVEL]);
if(skills[i][SKILL_LEVEL] < 11)
{
skills[i][SKILL_LEVEL] = 10;
skills[i][SKILL_TRIES] = lostSkillTries = 0;
break;
}
else
skills[i][SKILL_LEVEL]--;
}
skills[i][SKILL_TRIES] = std::max((int32_t)0, (int32_t)(skills[i][SKILL_TRIES] - lostSkillTries));
}
blessings = 0;
loginPosition = masterPosition;
if(!inventory[SLOT_BACKPACK])
__internalAddThing(SLOT_BACKPACK, Item::CreateItem(g_config.getNumber(ConfigManager::DEATH_CONTAINER)));
sendIcons();
sendStats();
sendSkills();
g_creatureEvents->playerLogout(this, true);
g_game.removeCreature(this, false);
sendReLoginWindow();
}
else
{
setLossSkill(true);
if(preventLoss)
{
loginPosition = masterPosition;
g_creatureEvents->playerLogout(this, true);
g_game.removeCreature(this, false);
sendReLoginWindow();
}
}
return true;
}
deathLostPercent = 10
function onSay(cid, words, param)
if getPlayerBlessing(cid,5) then ---defending player renewing the existing bless to protect from losing .
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 50,000 gp in backpack for blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA)
end
end
end
Well, the error isn't happening anymore, but, when people die with bless, they're still losing everything, including AOL. But, when they die without blesses, just using AOL, they don't lose AOLFrom line 2257 findreplace this class with this oneC++:uint32_t lostSkillTries, sumSkillTries;
replace thise also on your configC++:uint32_t lostSkillTries, sumSkillTries; for(int16_t i = 0; i < 7; ++i) //for each skill { lostSkillTries = sumSkillTries = 0; for(uint32_t c = 11; c <= skills[i][SKILL_LEVEL]; ++c) //sum up all required tries for all skill levels sumSkillTries += vocation->getReqSkillTries(i, c); sumSkillTries += skills[i][SKILL_TRIES]; lostSkillTries = (uint32_t)std::ceil(sumSkillTries * ((double)(percent * lossPercent[LOSS_SKILLS]) / 100.)); while(lostSkillTries > skills[i][SKILL_TRIES]) { lostSkillTries -= skills[i][SKILL_TRIES]; skills[i][SKILL_TRIES] = vocation->getReqSkillTries(i, skills[i][SKILL_LEVEL]); if(skills[i][SKILL_LEVEL] < 11) { skills[i][SKILL_LEVEL] = 10; skills[i][SKILL_TRIES] = lostSkillTries = 0; break; } else skills[i][SKILL_LEVEL]--; } skills[i][SKILL_TRIES] = std::max((int32_t)0, (int32_t)(skills[i][SKILL_TRIES] - lostSkillTries)); } blessings = 0; loginPosition = masterPosition; if(!inventory[SLOT_BACKPACK]) __internalAddThing(SLOT_BACKPACK, Item::CreateItem(g_config.getNumber(ConfigManager::DEATH_CONTAINER))); sendIcons(); sendStats(); sendSkills(); g_creatureEvents->playerLogout(this, true); g_game.removeCreature(this, false); sendReLoginWindow(); } else { setLossSkill(true); if(preventLoss) { loginPosition = masterPosition; g_creatureEvents->playerLogout(this, true); g_game.removeCreature(this, false); sendReLoginWindow(); } } return true; }
also try this on your talkactionsLua:deathLostPercent = 10
tested and worked, hope it works for you too .Lua:function onSay(cid, words, param) if getPlayerBlessing(cid,5) then ---defending player renewing the existing bless to protect from losing . doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA) else if doPlayerRemoveMoney(cid, 50000) == TRUE then for i = 1,5 do doPlayerAddBlessing(cid,i) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 50,000 gp in backpack for blessings.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA) end end end
make sure you added this attributes on items.xml that existing on your idWell, the error isn't happening anymore, but, when people die with bless, they're still losing everything, including AOL. But, when they die without blesses, just using AOL, they don't lose AOL
<attribute key="preventDrop" value="1"/>
<attribute key="slotType" value="necklace" />
<attribute key="charges" value="1"/>
Oh, thanks for the reply, i've been trying to do what you recommended me to do, but, it still doesn't work, the problem don't happen when the players have 4 blesses or less, but, if they're full of blesses, they lose everything, like if they were Red skull...make sure you added this attributes on items.xml that existing on your id
XML:<attribute key="preventDrop" value="1"/> <attribute key="slotType" value="necklace" /> <attribute key="charges" value="1"/>
-- WAITING FOR EDITOh, thanks for the reply, i've been trying to do what you recommended me to do, but, it still doesn't work, the problem don't happen when the players have 4 blesses or less, but, if they're full of blesses, they lose everything, like if they were Red skull...
Nothing that i've tried worked.-- WAITING FOR EDIT
Nothing that i've tried worked.
As i can see from yesterday using the teamviewer session i bet 100% that your sources actually bugged because it's too old and have many changes on the files also it's outdated version based on otx by "matyx " so i recommend to use another sources based on this tfs like this one Fir3element/3777 (https://github.com/Fir3element/3777) .I'm sorry if I uploaded the post, it will not be repeated, but I have this serious problem and my server is online, I don't know what to do, I'm losing players. can anybody help me?