• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ black skull question continued...

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.
I fixed my black skull to form what i want and i have problem:

I want to fix this:
- When you die you hp will be 40 and mana 0 <- i want delete it
- When you die you lose all items <- i want delete it
- When you have aol, the aol dont work with black skull <- i want delete it.

I want only fix black skull like normal skull (aol working, 0 things gone after death)

anyone can help me ?
 
It`s not in my scripts.
It`s in C++

Anyone have code where to change it ?
btw. thx sonical for hp problem ; p
 
player.cpp, remove red text:
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;
	if(getZone() == ZONE_PVP)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else[B][COLOR="red"] if(skull < SKULL_RED && g_game.getWorldType() != WORLD_TYPE_PVP_ENFORCED)[/COLOR][/B]
	{
 
player.cpp, remove red text:
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;
	if(getZone() == ZONE_PVP)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else[B][COLOR="red"] if(skull < SKULL_RED && g_game.getWorldType() != WORLD_TYPE_PVP_ENFORCED)[/COLOR][/B]
	{

I have this
Code:
if(getZone() == ZONE_HARDCORE)
I changed to PVP and removed red words and don't works
 
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;

	if(getZone() == ZONE_HARDCORE)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else
	{
? ?
 
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;
	if(getZone() == ZONE_HARDCORE)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else if(skull < SKULL_RED)
	{
 
My code:
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;
	if(getZone() == ZONE_HARDCORE)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else if(skull < SKULL_RED)
	{

your code
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;
	if(getZone() == ZONE_PVP)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else if(skull < SKULL_RED && g_game.getWorldType() != WORLD_TYPE_PVP_ENFORCED)
	{

I have to replace my code to yours? I'm using rev 3884 of 0.4
 
Last edited:
If red/black skull reach health 0 they don't die, they get teleported to temple and the death do not count :/
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;

	if(getZone() == ZONE_HARDCORE)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else
	{

If I set 'ZONE_PVP' it gives error in this line and don't compile

I set 'ZONE_OPEN' and If red/black skull reach health 0 they don't die, they get teleported to temple and the death do not count :/
Sorry double post, i didn't saw -.-



--------------------------------
If I set loss_items to 1 what happens?
 
Last edited by a moderator:
Must be one of your broken creaturescripts, there's nothing here that teleports to temple

(onPrepareDeath/onKill/onDeath)
 
For normal (full) hp and mana after death change in iologindata.cpp (if someone want it in c++):
[cpp]
bool IOLoginData::savePlayer(Player* player, bool preSave/* = true*/, bool shallow/* = false*/)
{
if(preSave && player->health <= 0)
{
if(player->getSkull() == SKULL_BLACK)
{
player->health = g_config.getNumber(ConfigManager::BLACK_SKULL_DEATH_HEALTH);
player->mana = g_config.getNumber(ConfigManager::BLACK_SKULL_DEATH_MANA);
}
else
{
player->health = player->healthMax;
player->mana = player->manaMax;
}
}
[/cpp]

To this:
[cpp]
bool IOLoginData::savePlayer(Player* player, bool preSave/* = true*/, bool shallow/* = false*/)
{
if(preSave && player->health <= 0)
{
player->health = player->healthMax;
player->mana = player->manaMax;
}
[/cpp]
 
Last edited:
This is also problem with your creaturescripts I think. Beacuse this source changes didn't break it.

Should this code work then?
Code:
bool Player::onDeath()
{
	Item* preventLoss = NULL;
	Item* preventDrop = NULL;

	if(getZone() == ZONE_OPEN)
	{
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}
	else
	{
 
Back
Top