Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Party system (https://forums.graalonline.com/forums/showthread.php?t=134264434)

greggiles 09-01-2011 10:49 AM

Party system
 
I did some research on the forums, and i have yet to see a thread on how to make a party system. Such as the one in zodiac, or maloria. What is the process someone would take to make one. I thought about it long and hard but i wouldnt know where to start.

Any thoughts?

Tricxta 09-01-2011 11:06 AM

Use guilds and just trigger the server which triggers the players with the same guild tag as the sending player. Then if you want you can always step it up so instead of relying on guilds you could create a database and have a new record for each group although I'm not sure even how I would do that that lol. Go with the guild idea and life will be easy >: )

Mark Sir Link 09-01-2011 11:30 AM

I'd personally do something like have a class called "party" or whatever else you want to name it with a few functions like addPlayer, removePlayer, getPlayers, invitePlayer etc.

then create a party by doing something like

PHP Code:

function newParty(){
  
temp.party = new TStaticVar("Party_"@player.account);
  
party.join("party");
  
party.addPlayer(player);


then in the class

PHP Code:

public function addPlayer(pobj){
  
pobj.party this;
  
this.members.add(pobj);


then when a player wants to invite someone, imagine by some chat command on the client that triggers the server with the account name

PHP Code:

function onActionServerside(cmdtarget){
  if(
cmd == "inv"){
    
player.party.invitePlayer(findplayer(target));
  }
  if(
cmd == "create"){
    
newParty();
  }



Tricxta 09-01-2011 11:48 AM

you good sir sure showed me up :0, rep+ although it doesn't count for anything lol, it's the thought that counts ;)


All times are GMT +2. The time now is 09:10 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.