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

2 creaturescript request & 1 advanced npc

breadmaker

New Member
Joined
Jul 16, 2010
Messages
160
Reaction score
3
Hello.
I have 2 creaturescript small requests and one advanced npc:

Tibia 8.50, TFS 0.3.5pl1

Creaturescript:
1) When we log in, we have 1 minute protection (monsters cannot attack us for 1 minute.
2) When we are under 30 level we got protection against drop our loot & lost level, skills when we die (something like blessing in rl tibia)

NPC:
I want NPC who trade stuff for small diamonds.
I have in my OT server diamonds system (like pacc)

NPC trade:
- 30 diamonds for 30 days premium (PACC)
- 10 diamonds for 10 days premium.
 
Im not making pokemon ots. I have only that idea (NPC) from pokemon, i got all needed - sms shop diamonds etc. but i need npc.
About 2 creaturescripts is good idea for new player and 1 minute protection after server crashes etc. (player is in zone of monsters :S)

Can you help me with this ? :D

BTW.
Your signature is f*king annoying. :S
 
1). Open your config.lua and change
Code:
loginProtectionPeriod = 60 * 1000

2). Open your login.lua and add the following.

Code:
for i = 1, 5 do
	if getPlayerBlessing(cid, i) then
		return true
	end
		
	if getPlayerLevel(cid) < 30 then
		if getPlayerGroupId(cid) < 3 then
			doPlayerAddBlessing(cid, i)
		end
	end
end

:thumbup:
 
1) When we log in, we have 1 minute protection (monsters cannot attack us for 1 minute.

Monsters WILL attack you, but you won't receive damage:
LUA:
 local storage = 34343
 local seconds = 60
 
 function onLogin(cid)
     exhaustion.set(cid, storage, seconds)
     registerCreatureEvent(cid, "loginPro")
     return true
 end
 
 function onStatsChange(cid, attacker, type, combat, value)
     if isPlayer(cid) and isMonster(attacker) and type == STATSCHANGE_HEALTHLOSS and exhaustion.check(cid, storage) then
         return false
     end
     return true
 end
XML:
 <event type="statschange" name="loginPro" event="script" value="loginPro.lua"/>

2) When we are under 30 level we got protection against drop our loot & lost level, skills when we die (something like blessing in rl tibia)
LUA:
function onLogin(cid)
    registerCreatureEvent(cid, "30pro")
    return true
end

function onPrepareDeath(cid, deathList)
    if isPlayer(cid) and getPlayerLevel(cid) < 30 then
        doCreatureSetDropLoot(cid, false)
        doPlayerSetLossSkill(cid, false)
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
        doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
    end
    return true
end
XML:
<event type="preparedeath" name="30pro" event="script" value="30pro.lua"/>
I guess login.lua resets those rates at player's login..

Stop trolling me. :mad:
hahah ^_^
 
ROFL I've noticed I missed posting the login events XML lines, did the scripts work for you anyways? :p

I know, i registered it manually :).

But how about:
NPC:
I want NPC who trade stuff for small diamonds.
I have in my OT server diamonds system (like pacc)

NPC trade:
- 30 diamonds for 30 days premium (PACC)
- 10 diamonds for 10 days premium.
 
Back
Top