• 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!

Feature Every changes you need to a Hardcore/War Server

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
First of all, i DIDN'T made this features, most part of then I get in requests.
If you did one or more of this features PM me and I will add your credits.
These features are working without problem in dev0.4 rev3884.
I get uptime of 300+ hours with 150+ players online all time(unfortunately not at dawn:D)

Black skull get full health when die
In iologindata.cpp change:
Code:
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;
		}
	}
to:
Code:
bool IOLoginData::savePlayer(Player* player, bool preSave/* = true*/, bool shallow/* = false*/)
{
	if(preSave && player->health <= 0)
	{
		player->health = player->healthMax;
		player->mana = player->manaMax;
	}

Black skull receive normal damage
In combat.cpp (Combat::CombatHealthFunc and Combat::CombatManaFunc) change:
You have to change two times
Code:
if(change < 0 && caster && caster->getPlayer() && target->getPlayer() && target->getPlayer()->getSkull() != SKULL_BLACK)
	change = change / 2;
to
Code:
if(change < 0 && caster && caster->getPlayer() && target->getPlayer())
	change = change / 2;

Don't get PK if attack unmarked player
In players.cpp remove:
Code:
if(skull == SKULL_NONE)
	{
		if(targetPlayer->getSkull() != SKULL_NONE)
			targetPlayer->sendCreatureSkull(this);
		else if(!hasCustomFlag(PlayerCustomFlag_NotGainSkull))
		{
			setSkull(SKULL_WHITE);
			g_game.updateCreatureSkull(this);
		}
	}

Don't get yellow skull if attack marked player
In players.cpp remove:
Code:
if((player == this || (skull != SKULL_NONE && player->getSkull() < SKULL_RED)) && player->hasAttacked(this))
			return SKULL_YELLOW;

No level difference restriction on kills
In players.cpp change:
Code:
double attackerLevel = (double)attackerPlayer->getLevel(), min = g_config.getDouble(
		ConfigManager::EFP_MIN_THRESHOLD), max = g_config.getDouble(ConfigManager::EFP_MAX_THRESHOLD);
	if((min > 0 && level < (uint32_t)std::floor(attackerLevel * min)) || (max > 0 &&
		level > (uint32_t)std::floor(attackerLevel * max)))
		return 0;
to:
Code:
double attackerLevel = (double)attackerPlayer->getLevel(), max = g_config.getDouble(ConfigManager::EFP_MAX_THRESHOLD);
	if(max > 0 && level > (uint32_t)std::floor(attackerLevel * max))
		return 0;

Red/black skull will not drop
In players.cpp change:
Code:
if(skull > SKULL_WHITE || (item->getContainer() && tmp < loss) || (!item->getContainer() && tmp < itemLoss))
{
	g_game.internalMoveItem(NULL, this, corpse, INDEX_WHEREEVER, item, item->getItemCount(), 0);
	sendRemoveInventoryItem((slots_t)i, inventory[(slots_t)i]);
}
to:
Code:
if(skull > SKULL_BLACK || (item->getContainer() && tmp < loss) || (!item->getContainer() && tmp < itemLoss))
{
	g_game.internalMoveItem(NULL, this, corpse, INDEX_WHEREEVER, item, item->getItemCount(), 0);
	sendRemoveInventoryItem((slots_t)i, inventory[(slots_t)i]);
}

Black skull can area spells
In spells.cpp find (Two times):
Code:
 if(!needTarget)
	{
		if(!isAggressive || player->getSkull() != SKULL_BLACK)
			return true;
 
		player->sendCancelMessage(RET_YOUMAYNOTCASTAREAONBLACKSKULL);
		g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
		return false;
	}

and replace with:
Code:
if(!needTarget)
		return true;

Also http://otland.net/f82/some-scripts-you-need-open-war-server-131729/
PS.: Remember to set world type 'open' in config.lua
 
Last edited:
Little update about the Area Spells (cannot use the area spells with blackskull) - let's remove this block!:

Find (Two times):
Lua:
 if(!needTarget)
	{
		if(!isAggressive || player->getSkull() != SKULL_BLACK)
			return true;
 
		player->sendCancelMessage(RET_YOUMAYNOTCASTAREAONBLACKSKULL);
		g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
		return false;
	}

and replace with:
Lua:
if(!needTarget)
		return true;
 
Not needed, you can use area spells with my edition xD


EDIT: Gz, I have this code but I forgot to post here UHAEHUAHEUAHE
thank you :p
 
Maybe someone write here a script when I died I not logout but I teleported to temple ;p
 
But how? Could you introduce me to this?
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doRemoveCondition(cid, CONDITION_INFIGHT)
		doCreatureAddHealth(cid, getCreatureMaxHealth(pid))
		doCreatureAddMana(cid, getCreatureMaxMana(pid))
end
return true
end
 
In lua it is to ass... Because, this script is not working, and if he working player don't gained experience, frag etc.

_________
Sorry for my fu*king english ;)
 
Can you show me where i change the time to remove frags.
I think this is by default 30 days end its is not configurable without change source.

Show me how to change this if it is possible.

thx.
 
i am not talking about skull time but the frag time, but the time to take off a injust kill, if it is configurable in config.lua can u tell me where i do this ?
 
In this part of player.cpp is wrong:
if(skull == SKULL_NONE)
{
if(targetPlayer->getSkull() != SKULL_NONE)
targetPlayer->sendCreatureSkull(this);
else if(!hasCustomFlag(PlayerCustomFlag_NotGainSkull))
{
setSkull(SKULL_WHITE);
g_game.updateCreatureSkull(this);
}
}

Only delete this:
if(skull == SKULL_NONE)
{
if(targetPlayer->getSkull() != SKULL_NONE)
targetPlayer->sendCreatureSkull(this);
else if(!hasCustomFlag(PlayerCustomFlag_NotGainSkull))
{
setSkull(SKULL_WHITE);
g_game.updateCreatureSkull(this);
}
 
Back
Top