-LUA & XML Kapitan wymagaj?cy Vip Access

Status
Zamknięty.

gum

Active User
Zarejestrowany
Dołączył
Maj 30, 2009
Posty
77
Liczba reakcji
1
Wiek
34
Witam, potrzebowa?bym NPC kapitana, kt?ry teleportuje za darmo w jedno miejsce ale wymaga Vip Access. Je?li co? potrzebne to pisa? .

NPC pod tibie 8.10 Evo
 
Odp: Kapitan wymagaj?cy Vip Access

podaj skrypt vipa medal i vip dor
 
Odp: Kapitan wymagaj?cy Vip Access

Vip access:

Kod:
function onUse(cid, item, frompos, item2, topos)

if item.itemid == 5785 then

local playerpos = getCreaturePosition(cid)

doRemoveItem(item.uid,5785)
setPlayerStorageValue(cid,21444,1)

doSendMagicEffect(playerpos, 12)
doPlayerSay(cid, "Congratulation! Now you are have VIP Access!!!", TALKTYPE_ORANGE_1)
end
end

Vip Door:

Kod:
function onUse(cid, item, frompos, item2, topos)
local storageValue = 21444
vipstatus = getPlayerStorageValue(cid,storageValue)
newnPosition = {x=830, y=897, z=7}
if vipstatus == 1 then
playerpos = getPlayerPosition(cid)
doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}
if item.actionid == 2075 and getPlayerStorageValue(cid,21444) == 1 then
doTeleportThing(cid,newnPosition)
doSendMagicEffect(newnPosition, 10)
doPlayerSay(cid, "Welcome on VIP !!!", TALKTYPE_ORANGE_1)
end
else
doPlayerSay(cid, "You don't have vip access!!!", TALKTYPE_ORANGE_1)
end
return 1
end

Jakby si? da?o to prosi?bym o zrobienie, ?e nie zu?ywa si? medalu tylko trzeba mie? go przy sobie, np. w bp, albo na strza?ach ... Je?li si? da. z g?ry dzi?kuj? :)
 
Ostatnia edycja:
Odp: Kapitan wymagaj?cy Vip Access

Reffresh....

Nagle temat zapomniany? :D
 
Odp: Kapitan wymagaj?cy Vip Access

To @up to jest nie mo?liwe bo dajmy gdy wbijesz juz na VIP'a i wyrzucisz medal to dalej b?dziesz na VIP'ie bez VIP'medala. tzn tak mi sie zdaje.
NPC'ta ci nie ogarn? ale mog? ci napisa? skrypt na item kt?ry teleportuje w dane miejsce gdy b?dziesz posiada? VIP'a.
 
Odp: Kapitan wymagaj?cy Vip Access

no dobra ale po co kto? mia?by wyrzuca? ten medal kiedy bez niego nie dosta?by si? drugi raz na vip ?
Je?li jest to nie mo?liwe to prosz? tylko o NPC!

Ten item dzia?a?by jak vip door wi?c jest mi zb?dny :) ale dzi?ki za ch?ci :D

Nadal czekam na odpowied?
 
Ostatnia edycja:
Odp: Kapitan wymagaj?cy Vip Access

No po to np: ze wejd? sobie na VIPa ?ci?gn? sobie VIP Medal i wrzuc? do teleportu a tam moja 2 posta? b?dzie mia?a odpalonego skrypta ze wszystko co pod nim ma zbiera? i zbierze VIP medal i wejdzie na teren VIP. I ju? w ten czas b?d? 2 OS kt?re wbili na VIP'a na 1 VIPie.
 
Odp: Kapitan wymagaj?cy Vip Access

Znajdzie si? taki NPC czy nie ? ;] (patrz kom. 1)
 
Odp: Kapitan wymagaj?cy Vip Access

@UP
Daj skrypt na "kapitana"...
 
Odp: Kapitan wymagaj?cy Vip Access

*.xml
Kod:
<npc name="Dikas" script="data/npc/scripts/gdzies.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
	<parameters>
		
	</parameters>
</npc>

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



-- OTServ event handling functions start
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
-- OTServ event handling functions end


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'mystic island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Vip Island for 50 gold coins?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 50, cost = 50, destination = {x=1447, y=1504, z=7} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})

local travelNode = keywordHandler:addKeyword({'house'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to House Land for 300 gold coins?'})
	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 50, cost = 300, destination = {x=836, y=978, z=6} })
	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})

keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Mystic Island and House\' for just a small fee.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Je?li mo?esz ustaw jedn? pozycje, kt?r? sam sobie dopisz?.
 
Odp: Kapitan wymagaj?cy Vip Access

Zrobi to kto? ? Pomaga? mi KabakOfDeath, ale NPC nie reaguje a on sam nie odpisuje :D Prosz? o pomoc :)
 
Odp: Kapitan wymagaj?cy Vip Access

Ehh bo pisales jak bylem na fonie albo nie bylo mnie na pc :*

Kod:
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

local vipisland = {x=1000, y=1000, z=7}

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	if(msgcontains(msg, 'destination') or msgcontains(msg, 'locations')) then
		selfSay('I can take you to \'Vip Island\' for just a small fee.', cid)
	end
	
	if(msgcontains(msg, 'vip island')) then
		selfSay('Do you wish to travel to Vip Island for 50 gold coins?', cid)
		talkState[talkUser] = 1
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
			if getPlayerLevel(cid) >= 50 then
				if isPremium(cid) == true then
					if getPlayerStorageValue(cid, 21444) == 1 then
							doTeleportThing(cid, vipisland)
							talkState[talkUser] = 0
						else
							selfSay('You don\'t have Vip Acces!', cid)
					end
					else
						selfSay('You don\'t have premium account!', cid)
				end
				else
					selfSay('You don\'t have 50 level!', cid)
			end
	elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
		selfSay('I wouldn\'t go there either.', cid)
		talkState[talkUser] = 0
	end
	end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Status
Zamknięty.
Back
Do góry