1º Paso.
Ir a...
tuot/data/action/script/
Create a lua with name "santadoll.lua".
And add this;
2º Paso.
go to
tuot/data/action/
Actions.xml add this;
And with this finish a santa doll
Preview:
~~*Santa Claus*~~
1º Paso.
Go to.
tuot/data/npc/script/tuot/data/npc/script/
Create a lua,with name santa.lua
And add
3º Paso.
Ir a...
tuot/data/npc/
Create a xml,with name "Santa Claus.xml"
and add;
with this finish,the npc!
Preview:
Lucky,and thanks(;
Creditos:
Unise -> 100% Santa Claus
Miisael -> 50% Santa Doll
ĐJ ĐєaŦђ -> 50 Santa Doll
Ir a...
tuot/data/action/script/
Create a lua with name "santadoll.lua".
And add this;
Code:
-- Script by DJ Death and Fixed by Miisael para Blacktibia--
local t = {
[1] = {2157},
[2] = {6531},
[3] = {2112},
[4] = {2111},
[5] = {2688}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[math.random(1,5)]
if v then
doPlayerAddItem (cid,v[1],1)
doPlayerSendTextMessage(cid,22,"JOJOJO Feliz Navidad!.")
doSendAnimatedText(getPlayerPosition(cid), "Regalo Otorgado!", math.random(1, 255))
doSendMagicEffect(getCreaturePosition(cid),12)
return TRUE
end
end
2º Paso.
go to
tuot/data/action/
Actions.xml add this;
Code:
<action itemid="6512" script="santadoll.lua" />
And with this finish a santa doll
Preview:
~~*Santa Claus*~~
1º Paso.
Go to.
tuot/data/npc/script/tuot/data/npc/script/
Create a lua,with name santa.lua
And add
Code:
local gifts = {
{10, 6531, 1}, -- 1% to get Santa Hat [10]
{40, 2112, 1}, -- 4% to get Teddy Bear [40]
{100, 2160, 10}, -- 10% to get 10 Crystal Coins [100]
{150, 2688, 10}, -- 15% to get 10 Candy Canes [150]
{150, 2152, 100}, -- 15% to get 100 Platinum Coins [150]
{200, 2111, 5}, -- 20% to get 10 Snowballs [200]
{250, 2675, 10}, -- 25% to get 10 Orange [250]
{350, 2674, 15}, -- 35% to get 10 Red Apples [350]
{400, 6512, 1}, -- 40% to get Santa Doll [40]
}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 SantaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if (parameters.present == true) then
if (getPlayerStorageValue(cid, PRESENT_STORAGE) == 1) then
selfSay("No me Pidas Mas ¬¬'! Ya te habia Dado un Regalo...", cid)
return true
end
local item = {}
local reward = 0
local count = ""
for i = 1, #gifts do
item = gifts[i]
if (math.random(0,999) < item[1]) then
reward = item[2]
subType = item[3]
if subType > 1 then
count = subType .. " "
end
break
end
end
doPlayerAddItem(cid, reward, subType)
setPlayerStorageValue(cid, PRESENT_STORAGE, 1)
npcHandler:say('HO-HO-HO! Tengo ' .. count .. getItemNameById(reward) .. ' para ti :).', cid)
else
npcHandler:say('Vuele hasta la Otra Navidad c:', cid)
end
npcHandler:resetNpc()
return true
end
npcHandler:setMessage(MESSAGE_GREET, "HO-HO-HO, Feliz Navidad |PLAYERNAME|. Yo Tengo Regalos para los que se Portan Mal.")
local noNode = KeywordNode:new({'no'}, SantaNPC, {present = false})
local yesNode = KeywordNode:new({'si'}, SantaNPC, {present = true})
local node = keywordHandler:addKeyword({'regalo'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Te Haz Portado Mal En Este Año?...'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
3º Paso.
Ir a...
tuot/data/npc/
Create a xml,with name "Santa Claus.xml"
and add;
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Santa Claus" script="santa.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="160" head="0" body="112" legs="93" feet="95"/>
</npc>
with this finish,the npc!
Preview:
Lucky,and thanks(;
Creditos:
Unise -> 100% Santa Claus
Miisael -> 50% Santa Doll
ĐJ ĐєaŦђ -> 50 Santa Doll