What's new

Npc sprzedaj?cy outfity, nie addony!

Status
Not open for further replies.

Astamor92

Active User
Joined
Jul 31, 2008
Messages
98
Reaction score
3
Mam pro?b?, m?g?by mi kto? napisac Npc, kt?ry sprzedaje outfity [Demonhunter, Norseman, Yalaharian, Brotherhood, Nightmare, Jester, Shaman, Pirate] za pomoc oczywi?cie b?dzie nagroda!
 

Gaul

User
Joined
Jun 14, 2009
Messages
38
Reaction score
2
Odp: Npc sprzedaj?cy outfity, nie addony!

Z tego co wiem nie ma takiego npc.

Pozdro.

EDIT@ Nie Ma Takiego NPC a Nikt Ci Za Darmo Nie Zrobi.
 
Last edited:

Astamor92

Active User
Joined
Jul 31, 2008
Messages
98
Reaction score
3
Odp: Npc sprzedaj?cy outfity, nie addony!

Prosz? o warna dla pana @up!
Prosz? o napisanie tego Npc, i nie wiele mnie interesuj? czy ju? istnieje czy nie...
 

Viz

Advanced User
Joined
Dec 16, 2008
Messages
186
Reaction score
24
Odp: Npc sprzedaj?cy outfity, nie addony!

Rozumiem,?e masz stary silnik w kt?rym Varkhal nie sprzedawa? jeszcze tych outfit?w.

Oto skrypt :

NPC :

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Varkhal" script="data/npc/scripts/addons.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>


Skrypt :

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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 buyAddons(cid, message, keywords, parameters, node)
--TODO: buyAddons function in modules.lua
if(not npcHandler:isFocused(cid)) then
return false
end

local addon = parameters.addon
local cost = parameters.cost
local premium = (parameters.premium ~= nil and parameters.premium)

if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddAddons(cid, addon)
npcHandler:say('There, you are now able to use all addons!', cid)
else
npcHandler:say('Sorry, you do not have enough money.', cid)
end
else
npcHandler:say('I only serve customers with premium accounts.', cid)
end

keywordHandler:moveUp(1)
return true
end

local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 5000 gold coins?'})
node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 5000, premium = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 10000 gold coins?'})
node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 10000, premium = true})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 5000 gold coins and the second addons set for 10000 gold coins.'})

npcHandler:addModule(FocusModule:new())

Jest to zwyk?y najnowszy Varkhal npc. Sprzedaje on wszystkie dost?pne outy w grze.
Je?eli chodzi?o Ci wy??cznie o te outfity w topicu to mog? zrobi? taki skrypt.
Na razie czekam na odpowied?.
 

Astamor92

Active User
Joined
Jul 31, 2008
Messages
98
Reaction score
3
Odp: Npc sprzedaj?cy outfity, nie addony!

W?a?nie chodzi mi tylko o outfity, kt?re poda?em wy?ej, jak b?dziesz pisa? skrypt to zr?b to tak aby Npc nie sprzedawa? addon?w do tych outfit?w!
Dzi?ki z g?ry ;]
 

Astamor92

Active User
Joined
Jul 31, 2008
Messages
98
Reaction score
3
Odp: Npc sprzedaj?cy outfity, nie addony!

~~Od?wie?am~~
Prosz? o szybk? odpowied?.
 

Sassin

Forum friend
Joined
Jun 13, 2009
Messages
1,281
Reaction score
107
Odp: Npc sprzedaj?cy outfity, nie addony!

~~~~~~od?wie?am~~~~~~:)
 
Status
Not open for further replies.
Top