What's new

Klucz od npc z actionid do otwacia danch drzwi

Status
Not open for further replies.

Ziolko33

User
Joined
Jul 29, 2008
Messages
25
Reaction score
2
Tak jak w temacie prosilbym o taki scrypt, jest mi on bardzo potrzebny. Dok?adnie chodzi mi o to, ?e dajemy npc jak?? rzecz lub kase, a on w zamian daje nam Klucz z okre?lonym Action ID (np. 5555) , do otwarcia drzwi (5555). Najlepiej jak by nie dalo sie dwa razy kupic tego klucza. Pozdrawiam
 

Ziolko33

User
Joined
Jul 29, 2008
Messages
25
Reaction score
2
Odp: Klucz od npc z actionid do otwacia danch drzwi

reffreszzz........................
 

andy1995

Senior User
Joined
Apr 12, 2009
Messages
602
Reaction score
100
Odp: Klucz od npc z actionid do otwacia danch drzwi

Masz tu skrypt .lua, xml chyba sam zrobisz ;p
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local key = doCreateItemEx(2088,1)
---------------------------------------------------------
if(msgcontains(msg, 'key') and getPlayerStorageValue(cid,45722) == -1) then
selfSay('Do you want buy this key for 1000 gold coins?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(doPlayerRemoveMoney(cid, 1000) == TRUE) then
doPlayerAddItemEx(cid,key,1)
doItemSetAttribute(key,"aid",5555)
setPlayerStorageValue(cid, 45722,1)
selfSay('Here you are, this is your key.', cid)
else
selfSay('Sorry, you don/t have enough money!', cid)
end
else
selfSay('Sorry, you can buy this key only on times!', cid)
return TRUE
end
---------------------------------------------------------
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

Ziolko33

User
Joined
Jul 29, 2008
Messages
25
Reaction score
2
Odp: Klucz od npc z actionid do otwacia danch drzwi

dzi?ki Ci wielkie za pomoc ;))
 
Status
Not open for further replies.
Top