Jump to content
  • 0

HELP ME with OnGuildBreak event


Mechomorph XD

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

how to get guild id from character when OnGuildBreak event is working?

Thank You :')

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   6
  • Joined:  01/25/12
  • Last Seen:  

* getcharid <type>{,"character name"};

This function will return a unique ID number of the invoking character, or, if a
character name is specified, of that character.
Type is the kind of associated ID number required:
0 - Character ID number.
1 - Party ID number.
2 - Guild ID number.
3 - Account ID number.

if (getcharid(2)) mes "Only members of a guild are allowed beyond this point!";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

Noooo, I mean when player use /breakguild <guild_name> command, how to get guild_id? cuz i will use guild_id when OnBreakGuild working

In agit_template have OnBreakGuild Event when guildmaster breakguild this event will working for abandon castle if they have a castle

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   6
  • Joined:  01/25/12
  • Last Seen:  

try working around getcastledata and setcastledata

make a guild or something then get the guild_id from your sql guild table

add in db/castle_db.txt:

100,prontera,My House,test,1

- script test -1,{
OnInit: // just for testing initialize the owner of the house or something
setcastledata ("prontera",1,<put guild_id here>);
end;
OnGuildBreak:
set .@guildid, getcastledata("prontera",1);
announce "Guild ID is : "+.@guildid,0;
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

If player use command on normal map (NOT castle) can be possible?

If use attachrid can do it? e.g.

OnBreakGuild:
attachrid(3,strcharinfo(0));
getcharid(2);

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   6
  • Joined:  01/25/12
  • Last Seen:  

You can't trigger guild break if your not adding the map to the castle database

// Guild Castles Database
//
// Structure of Database:
// CastleID,MapName,CastleName,OnGuildBreakEventName,Flag
//
// 01. CastleID				 Unique ID of the castle. Must remain unique across all map-servers.
// 02. MapName				  Map name to be considered as the castle map.
// 03. CastleName			   Name of the castle (used by scripts and guardian name tags).
// 04. OnGuildBreakEventName    NPC unique name to invoke ::OnGuildBreak on, when a occupied
//							  castle is abandoned during guild break.
// 05. Flag					 Switch flag (reserved as of athena-dev mod0796~0801, not used by server).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

Thank You /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   6
  • Joined:  01/25/12
  • Last Seen:  

and i think OnGuildBreak has no character attach because it is not invoke by a player so yeah /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

add in db/castle_db.txt:

100,prontera,My House,test,1

- script test -1,{
OnInit: // just for testing initialize the owner of the house or something
setcastledata ("prontera",1,<put guild_id here>);
end;
OnGuildBreak:
set .@guildid, getcastledata("prontera",1);
announce "Guild ID is : "+.@guildid,0;
end;
}

100,rent1,House Rent,Flag#rent1,1

-<tab>script<tab>Rent::Rent<tab>-1,{
end;
OnGuildBreak:
announce "Some word",0;
end;
}

rent1,100,100,0<tab>duplicate(Rent)<tab>Flag#rent1<tab>-1

OnInit:
setcastledata x,x,x;
end;

I do all above but script not announce when break guild. :)

Edited by Mechomorph XD
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   6
  • Joined:  01/25/12
  • Last Seen:  

100,rent1,House Rent,Flag#rent1,1 is the npc to trigger onguildbreak

and in your npc the name is Rent::Rent thats why it cant find the npc

while rent1,100,100,0<tab>duplicate(Rent)<tab>Flag#rent1<tab>-1 is just an alias for the npc named Rent,

you should changed main npc name to make it to work

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

I can do it already. Serious solved :(

Edited by Mechomorph XD
Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...