• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Meeting Stones (WoW Style)

avalock

New Member
Joined
Feb 5, 2013
Messages
16
Reaction score
3
Location
Great Britain
Well i requested help building tables as never done them on the support board but never got a reply, so i taught myself ^^. I figured out how to do what i wanted to so i thought i would share with everyone what i made incase anyone else needs something like this. Welcome to use / modify to your needs but if sharing the script / modified version please give credits!

What it is for?
You have an area that players would be team hunting in, but its a distance from your city(s), so normally you would put a NPC that teleports players to different zones, this is same concept but someone would have to make the effort to actually walk there first. Then they can summon all their party to the location, and the summoned targets can accept or ignore the invite.

There is 2 parts to this script, Action and TalkAction to make it work, its untested at the moment (will test soon).

Code:
MeetingStones(Action).lua:                                    
--    Meeting Stones Version 1.0.2
--    Meeting Stones (Action)
--    Created By Avalock
--    Last Edited: 10/08/2013
                                      
function onUse(cid, item, fromPosition, itemEx, toPosition)

local MeetingStones = {
    [0] = { -- Set Number to Stones UID.
            Name = "Exmaple", -- Name of the WarZone the Meeting Stone is linked too. This is important to input!
            StorageID = 00000 -- The storage ID that is linked to the meeting stones invite.
        },
    [40001] = {
            Name = "Dragons Den",
            StorageID = 40001
        },
    [40002] = {
            Name = "Bleh",
            StorageID = 40002
        }
},

local MSConfig = {
CoolDown = 125, -- 2 minutes 5 seconds.
CoolDownStorage = 40000,
RSMessage = ""..getCreatureName(cid).." is summoning you to "..MeetingStones[v].Name..". You have 2 minutes to say \'!warzone accept, "..MeetingStones[v].Name.."\'.",
NPMessage = "You aren\'t in a party.",
SAPMessage = "You have summoned all party members. Please wait for them to accept.",
CDMessage = "You must wait until you can summon more players.",
MSGType = MESSAGE_INFO_DESCR
}

local v = MeetingStones[item.uid]
if getPlayerParty(cid) == false and item.uid == v then
    doPlayerSendCancel(cid, MSConfig.NPMessage)
    elseif getPlayerParty(cid) == true and item.uid == v and getPlayerStorageValue(cid, MSConfig.CoolDownStorage) < os.time() then
  for _, pid in ipairs(getPlayersOnline()) do
  setPlayerStorageValue(cid, MSConfig.CoolDownStorage, os.time()+MSConfig.CoolDown)
    setPlayerStorageValue(party, MeetingStones[v].StorageID, os.time()+120)
      doPlayerSendTextMessage(party, MSConfig.MSGType, MSConfig.RSMessage)
   end
        doPlayerSendTextMessage(cid, MSConfig.MSGType, MSConfig.SAPMessage)
    else
        doPlayerSendTextMessage(cid, MSConfig.MSGType, MSConfig.CDMessage)
            return true
        end
    return 0
end
Add into actions.xml:
Code:
<action uniqueid="40001" script="MeetingStones(Action).lua"/>

MeetingStones(TalkAction.lua):
Code:
--    Meeting Stones Version 1.0.1
--    Meeting Stones (TalkAction)
--    Created By Avalock
--    Last Edited: 10/08/2013

function onSay(cid, words, param, channel)
local destinations = {
    [dragons den] = {
                        Storage = 40001,
                        Position = {x = 33167, y = 32006, z = 9}
                    }
}
local tp = destinations[string.lower(param)]


    if(param == "") then
        doPlayerSendCancel(cid, "Please enter the name of the WarZone you wish to accept the summons for.")
        return true
    end
    if getPlayerGroupId(cid) > 2 then
            doTeleportThing(cid, tp.Position)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You arrive safely at "..destinations[param].."!")
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) == true then
            doPlayerSendCancel(cid, "You can\'t accept a summons whilst in combat!")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)  
    elseif getPlayerStorageValue(cid, tp.storage) == -1 then
            doPlayerSendCancel(cid, "You haven\'t been summoned to this WarZone!")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    elseif getPlayerStorageValue(cid, tp.storage) >= os.time() then
            doPlayerSendCancel(cid, "Your invite has expired!")
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    else
            doTeleportThing(cid, tp.Position)
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You accepted the summons and arrive safely at "..destinations[param].."!")
    end
    return true
end

Add into talkactions.xml:
Code:
<talkaction words="!warzone accept," script="MeetingStones(TalkAction).lua"/>



Edit: Thanks to teckman for helping me learn some new things :)

Hope you like it! P.S. I am very new to using Tables, etc... so please don't be too harsh or negative if there is an easier way to do this, i'm still learning! That said i'm open to positive feed back and offers to show me either were i can find material to learn or direct help in learning :)
 
Last edited:
Kinda Weird can't you just make a teleport scroll to meeting place!?

Anyway Good luck learning :)
 
I like this concept a lot, its also worth mentioning the fact that you chose to offer your work to the forums even though you received no help, I respect that :) very cool.
 
[Dragons Den] should be ["dragons den"] and local tp = destinations[param] should be local tp = destinations[string.lower(param)].
 
I like this concept a lot, its also worth mentioning the fact that you chose to offer your work to the forums even though you received no help, I respect that :) very cool.

Thank you :) I will update to add new areas to database so a player cant have more than 1 invite, etc... without using any storages, will upload when i get a chance to make it. Also i just hoped that it meant there was no one who knew either what i wanted or how to do what i wanted avalable to help at the time and so i released this hoping even if not used, would help people learn from it possibly :)

Kinda Weird can't you just make a teleport scroll to meeting place!?

Anyway Good luck learning :)

They already exist as far as i'm aware, and for my project doesn't fit, i don't see everyone being able to just teleport at will to any location imaginable, this was built to make someone physically walk there first then allow them to summon the players to him. And thanks :) I'm learning all the time trying to better my self :)

[Dragons Den] should be ["dragons den"] and local tp = destinations[param] should be local tp = destinations[string.lower(param)].

Thanks man! :) Didnt even consider case sensistive. Will update now.
 
Back
Top