Jump to content
Ximboliex

[QUESTION] Call all menbers of guild

Recommended Posts

Please help:(

 

could help me create a script so that the leader can call all guild members to its location.

 

Scrip for Itemeffect.lua(double click)

 

 

--I'd appreciate it very much:sad:

Edited by Ximboliex

xbx3.png

Share this post


Link to post
Share on other sites

You can't. Unless you store a player's role with their respective guild information and then make a item to go through the stored information to call players.

Share this post


Link to post
Share on other sites
1 hour ago, Angelix said:

You can't. Unless you store a player's role with their respective guild information and then make a item to go through the stored information to call players.

I was thinking that I do not know where to start rather not do could publish as part of the script? @Angelix or @Totoka please?


xbx3.png

Share this post


Link to post
Share on other sites
26 minutes ago, Ximboliex said:

I was thinking that I do not know where to start rather not do could publish as part of the script? @Angelix or @Totoka please?

wont that be too broken?

you can do it for fun but i think that wont be good for the game

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, Nobre said:

wont that be too broken?

you can do it for fun but i think that wont be good for the game

no matter what adjustments will because I'm thinking how to implement:smile:

Thank's @Nobre


xbx3.png

Share this post


Link to post
Share on other sites
1 minute ago, Ximboliex said:

no matter what adjustments will because I'm thinking how to implement:smile:

Thank's @Nobre

anyway i advice you to try and build it

you can get a good mecanic that can be used in certain types of maps

 

Share this post


Link to post
Share on other sites

@Ximboliex

 

GetGuildLeaderID = Leader ID

GetGuildID = Guild ID

 

U cant do what u said in a function of item alone, because it executes on 1 player.

U have to hook it to something like a cha_timer, and then let that function teleport the players.

 

Edited by Shako

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites

@Shako

 

It won't work.

 

1) We don't have function GetGuildLeaderID();

3) Use GetChaGuildID() instead of GetGuildID();

4) You should compare guild leader id with character's ID, not with 1;

5) You should use GuildSummon as array:

GuildSummon[GuildID] = 1

6) In cha_timer() you should check if role is a player;

7) Script in cha_timer() will look like:

if (IsPlayer(role) == 1) then
	local GuildID = GetChaGuildID(role)
	if (GuildSummon[GuildID] ~= nil) then
		GuildSummon[GuildID] = nil
		MoveCity(role, "Guild House")
	end
end

 

  • Like 1

Share this post


Link to post
Share on other sites
On 10/28/2016 at 11:07 PM, Ximboliex said:

Please help:(

 

could help me create a script so that the leader can call all guild members to its location.

 

Scrip for Itemeffect.lua(double click)

 

 

--I'd appreciate it very much:sad:

Here You Go, But Make Sure All Credit To Yudha

Put This In Your functions.lua

--------------------------------------------------------------------------------------

function IsCanBeSummoned(role)
    local cha_lv     = Lv(role)
    local cha_job     = GetChaAttr(role,ATTR_JOB)
        local Slot1    = GetChaItem(role,1,9)
    local Slot1_ID    = GetItemID (Slot1)
    local BoatCheck = ChaIsBoat(role)
    if cha_lv <= 100 then
        return false
    end
    if cha_job <= 0 then
        return false
    end
    if Slot1_ID == 207 or Slot1_ID == 208 or Slot1_ID == 3108 then
        return false
    end
        if BoatCheck == 1 then
        return false
    end
    return true
end

---------------------------------------------------------------------------------------------------------------

And This In Your Functions.lua 

--------------------------------------------------------------------------------------------------------------

function CallAllTeleport(role, freq, time)
    local now_ticking     = GetChaParam(role, 1)
    local characterName     = GetChaDefaultName( role )
    local delay         = math.random(1,10)
    if IsCanBeSummoned(role) == true then
        if(GetName[characterName] ~= nil and _CallAll.Players[characterName] ~= nil)then
            if math.mod(now_ticking, delay) == 0 and now_ticking > 0 then
                BickerNotice(role,"Guild leader calling..!")
                GoTo( role,  _CallAll.Settings.X_Cord, _CallAll.Settings.Y_Cord, _CallAll.Settings.Map )
                _CallAll.Players[characterName] = nil
            end
        end
    end
end

---------------------------------------------------------------------------------------------------------------------------

Then This In Your ItemEffect.lua

----------------------------------------------------------------------------------------------------------------------------

function ItemUse_guildroar(role,Item)

	local map_name = GetChaMapName(role)
	if map_name == "hiddencamp" or map_name == "newbie" then
		UseItemFailed ( role )
		SystemNotice(role ,"Unable to calls guild members from here !")
	end
	
	local Leader_GuildID = GetChaGuildID( role )
	if Leader_GuildID < 1 then
		UseItemFailed ( role )
		SystemNotice(role ,"You dont have guild yet !")
	end

	local leader = IsGuildLeader(role)
	if leader == 1 then
		local x,y = GetChaPos(role)
		local map = GetChaMapName(role)
		for users,characters in pairs(GetName) do
			local characterName 	= GetChaDefaultName(characters)
			local Guild		= GetChaGuildID(characters)

			if Guild == Leader_GuildID then
				_CallAll.Settings = { Map = map, X_Cord = math.floor (x/100), Y_Cord = math.floor (y/100) }
				_CallAll.Players[characterName] = {}
				CallAllTeleport(characters)
			end
		end
	else
		UseItemFailed ( role )
		BickerNotice(role ,"You are not Guild leader !")
	end
end

-----------------------------------------------------------------------------------------------------------------------------

Last in Iteminfo.txt

9003	Guild Roar	trumpet	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	1	1	500	0	0	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_guildroar	0	0	0	0,0	0	0	Click it to calls guild members	0

------------------------------------------------------------------------------------------------------------------------------

 

Note: This Call All Members In Same GameServer Maybe @KONG or @V3ct0r or @Billy And Others Can Fix It

 

Edited by J0k3r
  • Like 1

Kind regards, AG.

Share this post


Link to post
Share on other sites
11 minutes ago, KONG said:

Hi joker. Nice script indeed. But If this was up to me, I would do the function inside groupserver.exe. When I get home I'll check it out for you guys.

OKay @KONG Waitting You

 


Kind regards, AG.

Share this post


Link to post
Share on other sites
On 11/19/2016 at 3:45 PM, J0k3r said:

Here You Go, But Make Sure All Credit To Yudha

Put This In Your functions.lua

--------------------------------------------------------------------------------------


function IsCanBeSummoned(role)
    local cha_lv     = Lv(role)
    local cha_job     = GetChaAttr(role,ATTR_JOB)
        local Slot1    = GetChaItem(role,1,9)
    local Slot1_ID    = GetItemID (Slot1)
    local BoatCheck = ChaIsBoat(role)
    if cha_lv <= 100 then
        return false
    end
    if cha_job <= 0 then
        return false
    end
    if Slot1_ID == 207 or Slot1_ID == 208 or Slot1_ID == 3108 then
        return false
    end
        if BoatCheck == 1 then
        return false
    end
    return true
end

---------------------------------------------------------------------------------------------------------------

And This In Your Functions.lua 

--------------------------------------------------------------------------------------------------------------


function CallAllTeleport(role, freq, time)
    local now_ticking     = GetChaParam(role, 1)
    local characterName     = GetChaDefaultName( role )
    local delay         = math.random(1,10)
    if IsCanBeSummoned(role) == true then
        if(GetName[characterName] ~= nil and _CallAll.Players[characterName] ~= nil)then
            if math.mod(now_ticking, delay) == 0 and now_ticking > 0 then
                BickerNotice(role,"Guild leader calling..!")
                GoTo( role,  _CallAll.Settings.X_Cord, _CallAll.Settings.Y_Cord, _CallAll.Settings.Map )
                _CallAll.Players[characterName] = nil
            end
        end
    end
end

---------------------------------------------------------------------------------------------------------------------------

Then This In Your ItemEffect.lua

----------------------------------------------------------------------------------------------------------------------------


function ItemUse_guildroar(role,Item)

	local map_name = GetChaMapName(role)
	if map_name == "hiddencamp" or map_name == "newbie" then
		UseItemFailed ( role )
		SystemNotice(role ,"Unable to calls guild members from here !")
	end
	
	local Leader_GuildID = GetChaGuildID( role )
	if Leader_GuildID < 1 then
		UseItemFailed ( role )
		SystemNotice(role ,"You dont have guild yet !")
	end

	local leader = IsGuildLeader(role)
	if leader == 1 then
		local x,y = GetChaPos(role)
		local map = GetChaMapName(role)
		for users,characters in pairs(GetName) do
			local characterName 	= GetChaDefaultName(characters)
			local Guild		= GetChaGuildID(characters)

			if Guild == Leader_GuildID then
				_CallAll.Settings = { Map = map, X_Cord = math.floor (x/100), Y_Cord = math.floor (y/100) }
				_CallAll.Players[characterName] = {}
				CallAllTeleport(characters)
			end
		end
	else
		UseItemFailed ( role )
		BickerNotice(role ,"You are not Guild leader !")
	end
end

-----------------------------------------------------------------------------------------------------------------------------

Last in Iteminfo.txt


9003	Guild Roar	trumpet	10130005	0	0	0	0	0	0	31	0	0	0	0	0	1	1	1	1	500	0	0	-1,-2,-2,-2	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	-1,-2,-2,-2,-2,-2,-2,-2,-2,-2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0	0,0	0,0	0	0	0	0	0	0	0	0	0	ItemUse_guildroar	0	0	0	0,0	0	0	Click it to calls guild members	0

------------------------------------------------------------------------------------------------------------------------------

 

Note: This Call All Members In Same GameServer Maybe @KONG or @V3ct0r or @Billy And Others Can Fix It

 

just use table.save to save the leader location and recall using cha_timer "table.load".

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...