• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction [Many] My fully lua PET system (MANY FEATURES)

how can i add the spells that are in the spells folder?
like utani gran hur, !petatk "utani gran hur
and how do i add voc, so x voc can use that spell? =(
didnt get the spell thing =s
?
 
Last edited:
Thank you, I've always liked Otfans because it was so great scripts there. But because of you.. I now rather take OtLand Because of you, Thanks:) btw Rep++
 
Mmm...
old thread but an old request i post it..
NPC lua file..
Code:
dofile("./petConfig.lua")
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)                          npcHandler:onCreatureAppear(cid)                        end
function onCreatureDisappear(cid)                       npcHandler:onCreatureDisappear(cid)                     end
function onCreatureSay(cid, type, msg)                  npcHandler:onCreatureSay(cid, type, msg)                end
function onThink()                                      npcHandler:onThink()                                    end
function creatureSayCallback(cid, type, msg)
        if(not npcHandler:isFocused(cid)) then
                return false
        end
		
	local costPerLevel = 300
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
        if msgcontains(msg, 'revive') then
            if getPlayerStorageValue(cid, storages.petUid) == 0 then
                if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
                    npcHandler:say('YOUR PET DIED?!, YOU\'R A BAD OWNER, THIS WILL COST YOU ' .. getPlayerLevel(cid)*costPerLevel .. ' GOLD COINS!, AGREE?!', cid)
                    talkState[talkUser] = 1
                else
                    npcHandler:say('Your pet is alive.', cid)
					talkState[talkUser] = 0
                end
            else
                 npcHandler:say('Your pet is standing next to you.', cid)
				 talkState[talkUser] = 0
            end
			
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] = 1)then
            if doPlayerRemoveMoney(cid, getPlayerLevel(cid)*costPerLevel) == TRUE then
                setPlayerStorageValue(cid, storages.petIsOnline, 1)
                npcHandler:say('You can now summon again your pet.', cid)
				talkState[talkUser] = 0
            else
                npcHandler:say('You don\'t have enought money.', cid)
				talkState[talkUser] = 0
            end
		elseif(msgcontains(msg, 'no') and talkState[talkUser] = 1)then	
			npcHandler:say('Ok so i can not do nothing for you.', cid)
			talkState[talkUser] = 0
		end
	return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Npc xml file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Madrid" script="revive.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="57" head="115" body="113" legs="31" feet="38" addons="3"/>
    <parameters>
        <parameter key="message_greet" value="Hello, |PLAYERNAME|!" />
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="help; pet" />
		<parameter key="keyword_reply1" value="I can revive your pet" />
		<parameter key="keyword_reply2" value="I can revive your pet" />

    </parameters>
</npc>

it should be works..
 
man put !petnick for agree nick pet

ej: pet demon -> pet nick Boby xd

CHANGE NAME PET PLS
 
This script is amazing, but could be even more amazing, Like true levels instead of just getting to another monsters.
 
This script is amazing, but could be even more amazing, Like true levels instead of just getting to another monsters.

haha hi gshade, coming from OTfans? this script rocks, dude
 
Pet revive talkaction minithread

HEY EVERYONE, I RE-SCRIPTED THE NPC CODE SO IT CAN BECOME AN EASY TALKACTION TO REVIVE PET. IT TAKES HALF OF THE USER'S MAX MANA, BUT YOU CAN EDIT

!revive.lua
PHP:
function onSay(cid, words, param)
	local magix = getPlayerMaxMana(cid)
	local formula = magix/2
	if getPlayerMana(cid) >= formula and isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 and getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
		setPlayerStorageValue(cid, storages.petIsOnline, 1)
		doPlayerAddMana(cid, -getPlayerMaxMana(cid)/2)
		doPlayerSendTextMessage(cid,22,"NOW YOU CAN SUMMON YOUR PET!")
else
    doPlayerSendCancel(cid,"You dont have enough mana.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end

ADD TO TALKACTIONS.XML:
PHP:
<talkaction words="!revive" script="pets/!revive.lua"/>

You may edit it for money, mana, health or whatever your players like best. Credits to FedeVI and the original scripter for this awesome system
 
Last edited:
HEY EVERYONE, I RE-SCRIPTED THE NPC CODE SO IT CAN BECOME AN EASY TALKACTION TO REVIVE PET. IT TAKES HALF OF THE USER'S MAX MANA, BUT YOU CAN EDIT

!resurrect.lua
PHP:
function onSay(cid, words, param)
	local magix = getPlayerMaxMana(cid)
	local formula = magix/2
	if getPlayerMana(cid) >= formula and isCreature(getPlayerStorageValue(cid, storages.petUid)) == 0 and getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
		setPlayerStorageValue(cid, storages.petIsOnline, 1)
		doPlayerAddMana(cid, -getPlayerMaxMana(cid)/2)
		doPlayerSendTextMessage(cid,22,"NOW YOU CAN SUMMON YOUR PET!")
else
    doPlayerSendCancel(cid,"You dont have enough mana.")
    doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end

ADD TO TALKACTIONS.XML:
PHP:
<talkaction words="!revive" script="pets/!revive.lua"/>

o_O
Mana is useless, you won't care if pet dies and thennnn he will start raping you so better use money ;)

and yea, It's me from OTFans, They keep banning me I had 6 different accounts and im tired of it also they started with ip ban now also
 
but of course -.- IF I SAID YOU COULD EDIT IT IT HAD A REASON! XD nah my script rocks anyway

EDIT: lol gshade you posted that very fast, didn notice when you answered me xD
 
PHP:
dofile("./petConfig.lua")

function onLogout(cid)
    if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 1 then
        if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
            setPlayerStorageValue(cid, storages.petIsOnline, 1)
        end
    end
    return TRUE
end

save last code as logout.lua@creaturescripts

then add to creaturescripts.xml:

PHP:
<event type="logout" name="Logout" script="logout.lua"/>

that ought to work, rep me if worked for u
 
Last edited:
PHP:
    if isCreature(getPlayerStorageValue(cid, storages.petUid)) == 1 then
        if getPlayerStorageValue(cid, storages.petIsOnline) == 2 then
            setPlayerStorageValue(cid, storages.petIsOnline, 1)
        end
    end

save last code as logout.lua@creaturescripts

then add to creaturescripts.xml:

PHP:
<event type="logout" name="Logout" script="logout.lua"/>

that ought to work, rep me if worked for u

ok thx
repped u ;p
 
Back
Top