• 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!

[Idea] Defend The Castle [Event]

cesar10

Active Member
Joined
Aug 4, 2009
Messages
428
Reaction score
37
Defend The Castle
[ A New Event ]


Well This Is A New Idea I Had But I Cant Script So Im Asking If Someone Can Please Make It For Me..

Features:


*Cm's Or Higher Can Activate Event
*PLayers Get A Math Random Price [Editable]
*After Event Finish It Will Broadcast Wich Team Won
*PLayers Can Choose To Be On Red Or Blue Team
*5 PLayers Minimum In Each Team, And 10 Maximum


How It Works?

Well What I Want The Event TO Do Is When Players Talk TO A Npc They Will Say Something Like This To It:

Player: Hi
Npc: Hello |playername| Will You Like To Join The Event?, Or You Can Ask Me For Information About It If You Are New At It...
PLayer: Join Event
Npc: Oh.. Well, Wich Team Will You Want To Join
Player: |Team name|
Npc: Ok Your On.



After That Player Gets Teleported To x Pos [depending On Its Team]
After 1 Minute A 2 Diferent Raids Start One In First Castle And Other In Second

Well The Castle Entrence Is Where PLayers Will Be If Any Monster gets Inside A Team Castle The Other Team Wons And It Broadcast It Then All Players From The Wining Team get A MathRandom Price From List And Get Teleported To Temple




Thats It If Any1 Can Help me Il Rep++ Hope You Liked The Idea :D ^_^
 
Made npc :D
data/npc/scripts/event npc.lua
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

 
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 redpos = {x=EDIT, y=EDIT, z=EDIT}
local bluepos = {x=EDIT, y=EDIT, z=EDIT}
 
function creatureSayCallback(cid, type, msg)
if (msgcontains(msg, 'join')) then
   npcHandler:say('Would you like to join the event?', cid)
                           Topic[cid] = 1
elseif msgcontains(msg, 'yes') and Topic[cid] == 1 then
       npcHandler:say('What team would you like? Red or Blue?', cid)
                           Topic[cid] = 2
elseif msgcontains(msg, 'no') and Topic[cid] == 1 then
       npcHandler:say('Next time then!')
                            Topic[cid] = 0
elseif msgcontains(msg, 'red') and Topic[cid] == 2 then
       npcHandler:say('Okay, Here you go!', cid)
       doTeleportThing(cid,redpos)
                            Topic[cid] = 0
elseif msgcontains(msg, 'blue') and Topic[cid] == 2 then
       npcHandler:say('Okay, Here you go!', cid)
       doTeleportThing(cid,bluepos)
                            Topic[cid] = 0 
                            end
       return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

data/npc/name.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="name" script="data/npc/scripts/event npc.lua" walkinterval="1000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="79" body="113" legs="105" feet="86" addons="0"/>
        <parameters>
                <parameter key="message_greet" value="HHello |PLAYERNAME|, talk to me if you'd like to {join} the event?!"/>
                <parameter key="message_farewell" value="Good bye |PLAYERNAME|!."/>
 
    </parameters>
 
</npc>
 
@Up Thx
Liked The Idea?

Edited:
Well I Need Script So When Event Ends Player Get Price And Get Teleported

Oh Forgot Can You Add Something Like If Player Have x Storage He Cant GO In Event Anymore
 
Last edited:
@Up Thx
Liked The Idea?

Edited:
Well I Need Script So When Event Ends Player Get Price And Get Teleported

Oh Forgot Can You Add Something Like If Player Have x Storage He Cant GO In Event Anymore

You mean that each player can play the event only once?
 
Back
Top