• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[NPC] Arena :D

arekziomal

New Member
Joined
Feb 26, 2009
Messages
102
Reaction score
0
Location
U.K
Witam

Mam taki problem... gdyż gdy pisze do Halvara
16:56 ziomal [300]: hi
16:56 Halvar: Hello ziomal! Do you want to make arena?
16:56 ziomal [300]: yes
16:56 Halvar: You test will be greenshore level. If you want enter you must pay 1000 gp and have 30 level. Wanna try?
16:56 ziomal [300]: yes
16:56 Halvar: You don't have 1000 gp! Come back when you will be ready!

To on odpisuje ze kasy nie mam a mam ponad 100 cc w bp -.-

Skrypt :
Code:
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 enterArena(cid, message, keywords, parameters, node)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	local cost = 0
	local levelname = ''
	if getPlayerStorageValue(cid, 42355) < 1 then
		cost = 1000
		levelname = 'greenshore'
		levelneeded = 30
	elseif getPlayerStorageValue(cid, 42355) == 1 then
		cost = 5000
		levelname = 'scrapper'
		levelneeded = 50
	elseif getPlayerStorageValue(cid, 42355) == 2 then
		cost = 10000
		levelname = 'warlord'
		levelneeded = 80
	end
	if string.lower(keywords[1]) == 'yes' and parameters.prepare ~= 1 then
		if(getPlayerLevel(cid) >= levelneeded) then
			if(getPlayerMoney(cid) >= cost) then
				doPlayerRemoveMoney(cid, cost)
				npcHandler:say('Now you can go to test.', cid)
				setPlayerStorageValue(cid, 42351, 1)
			else
				npcHandler:say('You don\'t have ' .. cost .. ' gp! Come back when you will be ready!', cid)
		    end
		else
			npcHandler:say('You don\'t have ' .. levelneeded .. ' level! Come back when you will be ready!', cid)
		end
		npcHandler:resetNpc()
	elseif string.lower(keywords[1]) == 'no' then
		npcHandler:say('Come back later then!', cid)
		npcHandler:resetNpc()
	else
		if getPlayerStorageValue(cid, 42355) < 3 then
			npcHandler:say('You test will be ' .. levelname .. ' level. If you want enter you must pay ' .. cost .. ' gp and have ' .. levelneeded .. ' level. Wanna try?', cid)
		else
			npcHandler:say('You did all arena levels.',cid)
		end
	end
	return true
end

npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|! Do you want to make arena?')

local yesNode = KeywordNode:new({'yes'}, enterArena, {})
local noNode = KeywordNode:new({'no'}, enterArena, {})

local node1 = keywordHandler:addKeyword({'arena'}, enterArena, {prepare=1})
	node1:addChildKeywordNode(yesNode)
	node1:addChildKeywordNode(noNode)
	
local node1 = keywordHandler:addKeyword({'fight'}, enterArena, {prepare=1})
	node1:addChildKeywordNode(yesNode)
	node1:addChildKeywordNode(noNode)
local node1 = keywordHandler:addKeyword({'yes'}, enterArena, {prepare=1})
	node1:addChildKeywordNode(yesNode)
	node1:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

próbowałem już każdego jakiego znalazłem ale dupa, nawet od kolegi wziełem ale dalej -.-

Kod z Halvar.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Halvar" script="data/npc/scripts/quest/arena.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
<look type="143" head="3" body="77" legs="78" feet="97" addons="1"/>
     <parameters>
  <parameter key="message_greet" value="Hello competitor! Do you want to fight in the arena or shall I explain the rules first?"/>
    
	    <parameter key="module_keywords" value="1" />
        <parameter key="keywords" value="rule;die;death;greenhorn;scrapper;warlord;price;general;difficulties;levels;difficulty;fee;"/>
        <parameter key="keyword_reply1" value="What do you want to know? Something about the three different {difficulties}, the {general} rules or the {prices}? Maybe you also want to know what happens when you {die}?" />
        <parameter key="keyword_reply2" value="It would be better not to {die}! In every pit there is an emergency exit, the portal to the south. If you {die} in a pit... well... your corpse and backpack are gone, so you enter the arena at your own risk." />
        <parameter key="keyword_reply3" value="It would be better not to {die}! In every pit there is an emergency exit, the portal to the south. If you {die} in a pit... well... your corpse and backpack are gone, so you enter the arena at your own risk." />
        <parameter key="keyword_reply4" value="That is the easiest way in our arena. The {fee} is 1500 gold. We were setting this up for of our children to challenge some easy monsters and train them for the future" />
        <parameter key="keyword_reply5" value="The most common difficulty for us. The {fee} is 5000 gold. So if you are experienced in fighting middle class monsters this is your challenge!" />
        <parameter key="keyword_reply6" value="Only the strongest among us will take this challenge. The {fee} is 10000 gold. If you pass that I promise you the respect of all citizens here. You will be a hero!" />
        <parameter key="keyword_reply7" value="The {fee} is either 1000, 5000 or 10000 gold for one try. Remember that if you {die}, it is YOUR problem and you won't be able to get back to your corpse and your backpack." />
        <parameter key="keyword_reply8" value="Basically you pay me a {fee}, and you are sent into an arena with 10 different stages. If you succeed you will be rewarded accordingly." />
        <parameter key="keyword_reply9" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply10" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply11" value="There are three difficulties: {Greenhorn}, {Scrapper} and {Warlord}. On each challenge you will be confronted with ten monsters increasing in strength." />
        <parameter key="keyword_reply12" value="The {fee} is either 1000, 5000 or 10000 gold for one try. Remember that if you {die}, it is YOUR problem and you won't be able to get back to your corpse and your backpack." />
</parameters>

</npc>

Za pomoc REP++ :D
 
Nie mam modów żadnych, sam NPC
quest się składa z paru plików lua umieszczonych w
lib, movements, actions oraz creaturescipts.
 
16:56 Halvar: You test will be greenshore level. If you want enter you must pay 1000 gp and have 30 level. Wanna try?

Angielski kurwa Angielski...
Your test[...] want to[...]
 
Back
Top