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

[Request]Advance level 100

Thaz

๖OrgeaRPG Project
Joined
Jun 5, 2008
Messages
188
Reaction score
0
Location
127.0.0.1
Hi!
I want a script that makes a Broadcast when someone advance s to level 100,200 or 300.

^_^
 
I think it can be created at creaturescripts... but I'm new in creaturescripts so, by now, I don't know :p, but am 90% sure u use creaturescripts for this
 
Hmm, there might be a "onLevelUp" creaturescript function. I'll look into it. If there is, I'll make the script for you.
 
on 0.2 atm the only creaturescripts are
Code:
enum CreatureEventType_t
{
	CREATURE_EVENT_NONE,
	CREATURE_EVENT_LOGIN,
	CREATURE_EVENT_LOGOUT,
	CREATURE_EVENT_THINK,
	CREATURE_EVENT_PREPAREDEATH,
	CREATURE_EVENT_DEATH,
	CREATURE_EVENT_KILL
};
But you can make it will loop but probb will lag... The other way is editing sources...
 
Then I don't think it's possible just yet, Not without 4220Niller's onAdvance function, that isn't working with newer TFS.
 
Can anyone give me the script please ^_^

I can give you the code on c++

On player.cpp ctr+f
Code:
You advanced from Level %d to Level %d.", prevLevel, newLevel);
and under
Code:
sendTextMessage(MSG_EVENT_ADVANCE, levelMsg);
Add
Code:
		if(newLevel == 300){
		char bc[70];
		sprintf(bc, "New LEVEL %d !!! You advanced from Level %d to Level %d.", newLevel, prevLevel, newLevel);
		Player* player = getPlayer();
		g_game.playerBroadcastMessage(player, bc);}

NOTE: This one is only for level 300

EDIT: Sorry this code only work on persons with flags gonna fix it soon and edit my post

Edit: for do it on a easy way open game.cpp ctrl+f playerBroadcastMessage
and delete
Code:
	if(!player->hasFlag(PlayerFlag_CanBroadcast))
		return false;
Note: im not sure if that have another use... since the command /B check your acces/group_id
 
Last edited:
i think it should be like this.

PHP:
playername = getCreatureName(cid)

if isPlayer(cid) == TRUE then
if getPlayerLevel(cid) == 100 then
broadcastMessage("..playername.." just reached level 100, MESSAGE_STATUS_WARNING)

or something like this
 
Code:
	if ((isPlayer(cid) == TRUE) and (getPlayerLevel(cid) == 100)) then
	   broadcastMessage("..getCreatureName(cid).." just reached level 100, MESSAGE_STATUS_WARNING)
 
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
    if newlevel == 100 then
        doPlayerBroadcastMessage(cid, ".. getCreatureName(cid) .. has reached level 100, congratulations!")
    elseif newlevel == 200 then
        doPlayerBroadcastMessage(cid, ".. getCreatureName(cid) .. has reached level 200, congratulations!")
    elseif newlevel == 300 then
        doPlayerBroadcastMessage(cid, ".. getCreatureName(cid) .. has reached level 300, congratulations!")
    end
    return TRUE
end

Jo3
 
little fix & edit
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if newlevel == 100 or newlevel == 200 or newlevel == 300 then
		broadcastMessage(getCreatureName(cid) .. " has reached level " .. newlevel .. ", congratulations!")
	end
	return TRUE
end
 
little fix & edit
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	if newlevel == 100 or newlevel == 200 or newlevel == 300 then
		broadcastMessage(getCreatureName(cid) .. " has reached level " .. newlevel .. ", congratulations!")
	end
	return TRUE
end

Thanks, :).

Jo3
 
Back
Top