[Help Thread] Please post your questions here.

03/17/2017 06:43 sapir619#6226
Quote:
Originally Posted by smoegsmoeg View Post
Thanks, but does not work.

atm I run everything in server_init
add_event_state(9004,1) <- HV <- Works
cast_world_state(2506,31) <- First buff <- no effect
add_event_state(2506,31) <- works only on character
add_event_cstate(2506,31) <- no effect
cast_world_cstate(2506,31) <- no effect

I'd be more than ok with a script that buffed every 1minute (that way I have the HV return pass as well (yeah i know you have it 60 times in inv. but idc about that))

any suggestions?

thanks in advance
You miss 1 parameter for "cast_world_state", cast_world_state(state_id, state_level, time),

Example:
cast_world_state(2506, 31, 500)

My advice to you is to run the world buff you want via the server init file and for the pets write a script in "on_login.lua", anyway you can add an option to buff the pets from in-game.
Note: if you'll use "on_login.lua" for the pets, only 1 summoned pet gets it I assume.
03/17/2017 11:46 _-Seizure-_#6227
Quote:
Originally Posted by smoegsmoeg View Post
Thanks, but does not work.

atm I run everything in server_init
add_event_state(9004,1) <- HV <- Works
cast_world_state(2506,31) <- First buff <- no effect
add_event_state(2506,31) <- works only on character
add_event_cstate(2506,31) <- no effect
cast_world_cstate(2506,31) <- no effect

I'd be more than ok with a script that buffed every 1minute (that way I have the HV return pass as well (yeah i know you have it 60 times in inv. but idc about that))

any suggestions?

thanks in advance
check if you have in server_init.lua in function on_server_init() this line:

for_event_by_liveteam() (if not add it.)

If you have that function, open NPC_Event.lua and search for it.

i cleaned the time based triggers and modified it for my intentions.

Heres a little snippet wich will do a loop every 2 Minutes to refresh the buffs on each player + creature.

Code:
function for_event_by_liveteam()
	play_time_event() 
end


function play_time_event()

	set_env( "game.use_time_based_event_script",1 )
	set_env( "game.term_for_time_based_event_script",2 )

end

function on_time_based_event_reward() 

private_notice("2 Minute Trigger - Buffs refreshed")
cast_world_state(2506,31,0) 
cast_world_cstate(2506,31,0) 

end
03/18/2017 17:39 mongreldogg#6228
couldn't imagine i'll turn to this thread :D
but hey, did anyone ever handle hashed ID given to a shop URL when opening it ingame? It seems like MD5 hash provided by a client but i cant see how dahell it generates.

JSON representation of $_REQUEST variable:
[Only registered and activated users can see links. Click Here To Register...]
03/18/2017 21:57 _-Seizure-_#6229
Quote:
Originally Posted by mongreldogg View Post
couldn't imagine i'll turn to this thread :D
but hey, did anyone ever handle hashed ID given to a shop URL when opening it ingame? It seems like MD5 hash provided by a client but i cant see how dahell it generates.

JSON representation of $_REQUEST variable:
[Only registered and activated users can see links. Click Here To Register...]
Code:
if(!isset($_SESSION['accountId']) || isset($_GET['id']))
{
	$client=new client_guild_login();
	$myuser=$client->accountName;
	$mypass="%23%23%23".$client->userPassword;

	$expire=file_get_contents($BASE_URL.$SYS_FRONT."?un=".$testUser."&pw=".$testPass."&_tdl=%25-222396333&_vas=[userName=".$myuser.",password=".$mypass."]&_cnc=pk&_an=getExpirationDate") ;
	$expire=date('d/m/Y',strtotime($expire));	
	$_SESSION['shop_expiredate']=trim($expire);
}
else
{
	$client=new client_guild_login();
	$client->setValues($_SESSION['accountId'],$_SESSION['accountName'],$_SESSION['serverName'],$_SESSION['avatarName'],$_SESSION['avatarId'],$_SESSION['userPassword']);

$expire=$_SESSION['shop_expiredate'];

}
//USER NAME AND PASSWORD TO ACCESS BILLING SYSTEM FOR USER
$myuser=$client->accountName;
$mypass="%23%23%23".$client->userPassword;

//Init Values
if($client->isValid=="false")
{
	$show_message_page=true;
	$message="_PROCESS_DENIED";
	
}


class client_guild_login extends DbConnector{
	var $avatarId = "";
	var $accountId = "";
	var $accountName = "";
	var $avatarName = "";
	var $passWord = "";
	var $userPassword="";
	var $serverName = "";
	var $isValid = "";
	function client_guild_login()
	{
	

		$moveUrl = "login.php";
		$encodeId="";
		if(isset($_GET["id"]))
		{
			$encodeId = $_GET["id"];
		}
		if(isset($_GET["server"]))
		{
		$this->serverName = $_GET["server"];
		}
		//$encodeId = $this->Encode();
		//echo $encodeId;
		//die();
		$this->Decode($encodeId);
		if ($this->AvatarCheck() == true)
		{
			$this->isValid="true";
		}
		else
		{
			$this->isValid="false";
		
		}
	}
	function Encode()
	{
		$avatar_id = 8371229;
		$account_id = 42;
		$password =595	;
		$checksum =  $avatar_id + $account_id + $password;

		//Random randObj = new System.Random();
		$randObj= rand(1,1000);
		$randObj1= rand(1,10);
		$randObj2= rand(1,10);

		$seed = ($randObj * $randObj * $randObj);
		$avatar_id ^= $seed;
		$account_id ^= $avatar_id;
		$password ^= $account_id;
		$checksum ^= $password;

		$avatar_id ^= 0xD8FB51A9;
		$account_id ^= 0x9DC720AC;
		$password ^= 0x31F42CB7;
		$checksum ^= 0x7F9B3D2E;

		$result = "";

		$result .= $this->dec2hex($seed,8);
		$result .= $this->dec2hex($avatar_id,8);
		$result .=  $this->dec2hex($account_id,8);
		$result .=  $this->dec2hex($password,8);
		$result .= $this->dec2hex($checksum,8);

		return $result;
	}
	function dec2hex($dec, $digits=false) {

		$hex =  '';
		$sign = $dec < 0 ? false : true;
		while ($dec) {
			$hex .= dechex(abs(bcmod($dec, '16')));
			$dec = bcdiv($dec, '16', 0);
		}
		if ($digits) {
			while (strlen($hex) < $digits) { $hex .= '0'; }
		}
		if ($sign) {
			return strrev($hex);
		}
		for ($i = 0; isset($hex[$i]); $i++) { $hex[$i] = dechex(15 - hexdec($hex[$i])); }
		for ($i = 0; isset($hex[$i]) && $hex[$i] == 'f'; $i++) { $hex[$i] = '0'; }
		if (isset($hex[$i])) { $hex[$i] = dechex(hexdec($hex[$i]) + 1); }
		return strrev($hex);
	}

	function Decode($encodeId)
	{
		$seed;
		$avatar_id;
		$account_id;
		$password;
		$checksum;

		if (strlen($encodeId) != 40)
		{

		}

		$seed = hexdec(substr($encodeId,0,8));
		$avatar_id = hexdec(substr($encodeId,8,8));
		$account_id = hexdec(substr($encodeId,16,8));
		$password = hexdec(substr($encodeId,24,8));
		$checksum = hexdec(substr($encodeId,32,8));
		$avatar_id ^= 0xD8FB51A9;
		$account_id ^= 0x9DC720AC;
		$password ^= 0x31F42CB7;
		$checksum ^= 0x7F9B3D2E;

		$checksum ^= $password;
		$password ^= $account_id;
		$account_id ^= $avatar_id;
		$avatar_id ^= $seed;

		if ($checksum != $avatar_id + $account_id + $password)
		{

		}
		$this->passWord = $avatar_id;
		$this->avatarId = $account_id;
		$this->accountId = $password;
	}

	function AvatarCheck()
	{
		$isValidAvatar = false;
		$connectName = "";

		$isMember = false;
		parent::DbConnector("Telecaster");
		odbc_exec($this->conn,"use Telecaster");

		$myArray=odbc_exec($this->conn,"exec SP_Check_OTP '".$this->avatarId."','".$this->accountId."','".$this->passWord."'");
		
		$row =odbc_fetch_array($myArray);
		odbc_close($this->conn);
		$this->avatarName=$row['name'];
		$this->accountName=$row['account'];
		if ($this->avatarName != "")
		{
			$isValidAvatar = true;
			parent::DbConnector("Auth");
			odbc_exec($this->conn,"use Auth");
			$query="sp_get_account_pass ".$this->accountId."";
			$account=odbc_exec($this->conn, $query);
			$accountArray=odbc_fetch_array($account);
			odbc_close($this->conn);
			$this->userPassword=$accountArray['password'];
			

			$_SESSION['accountId']=trim($this->accountId);
			$_SESSION['accountName']=trim($this->accountName);
			$_SESSION['serverName']=trim($this->serverName);
			$_SESSION['avatarName']=trim($this->avatarName);
			$_SESSION['avatarId']=trim($this->avatarId);
			$_SESSION['userPassword']=trim($this->userPassword);

			
			
		
		}
		else
		{	

			$isValidAvatar = false;
		}
		return $isValidAvatar;
	}
	function setValues($accountId,$accountName,$serverName,$avatarName,$avatarId,$userPassword)
	{		
			parent::DbConnector("Auth");
			
			odbc_exec($this->conn,"use Auth");
			$query="sp_get_account_pass ".$this->accountId."";
			$account=odbc_exec($this->conn, $query);
			$accountArray=odbc_fetch_array($account);
			odbc_close($this->conn);
			if(!$accountArray['password']==$userPassword)
			{
				$isValidAvatar = false;
			}
			$this->accountId=$accountId;
			$this->accountName=$accountName;
			$this->serverName=$serverName;
			$this->avatarName=$avatarName;
			$this->avatarId=$avatarId;
			$this->userPassword=$userPassword;
			$this->isValid="true";
	}

}
03/18/2017 22:44 smoegsmoeg#6230
Quote:
Originally Posted by _-Seizure-_ View Post
check if you have in server_init.lua in function on_server_init() this line:

for_event_by_liveteam() (if not add it.)

[...]

[/code]
Thanks - that was kinda what I was looking for yet I get an error: Herlock starts into an error:
[Only registered and activated users can see links. Click Here To Register...]

I have "for_event_by_liveteam()" in my server_init.lua I edited the bit in NPC_event.lua yet herlock crashes now - deleting all results in crash.

adding it just in ends in nothing happening. (see spoiler)

I don't know enough to know what to sanitize and what to leave - or if I am at the correct segment
(I'm using the "retail" 9.1 how to PServer)


Thanks,
sm
03/18/2017 23:24 ThunderNikk#6231
To do what they are suggesting you have to get rid of the entire script (not the entire .lua but just the time based portion of it) and only include what they have written for you.

It will make it impossible to use the script for log in rewards.

Not sure how theirs works every 2 minutes as mine is a one shot deal you get one reward after the 15 minutes that I edited it to and that is it.
03/19/2017 07:22 Sherock#6232
Quote:
Originally Posted by _-Seizure-_ View Post
check if you have in server_init.lua in function on_server_init() this line:

for_event_by_liveteam() (if not add it.)

If you have that function, open NPC_Event.lua and search for it.

i cleaned the time based triggers and modified it for my intentions.

Heres a little snippet wich will do a loop every 2 Minutes to refresh the buffs on each player + creature.

Code:
function for_event_by_liveteam()
	play_time_event() 
end


function play_time_event()

	set_env( "game.use_time_based_event_script",1 )
	set_env( "game.term_for_time_based_event_script",2 )

end

function on_time_based_event_reward() 

private_notice("2 Minute Trigger - Buffs refreshed")
cast_world_state(2506,31,0) 
cast_world_cstate(2506,31,0) 

end
if you used cast_world_state you will get a crash
03/19/2017 19:26 smoegsmoeg#6233
Quote:
Originally Posted by Sherock View Post
if you used cast_world_state you will get a crash
so in that case what would actually do the trick then? for pets?
03/19/2017 20:35 _-Seizure-_#6234
Quote:
Originally Posted by smoegsmoeg View Post
so in that case what would actually do the trick then? for pets?
Since this is a trigger for each character on the server wich is online, you can try add_cstate () instead of cast_world_state()

Didnt tested the cast_world_state in this trigger.
03/20/2017 14:58 kojima2501#6235
hi all
i try dev remix battle map (island pvp) i want affect point into other table cause flag_list (in character can't update manually) i need winnername and losername for affect my new point but i don't know how to have this

if one have one idea pls ^^ <3
03/22/2017 13:35 アルカード#6236
I got one issue if more experienced dev could help out a bit.
I am adding skill to new pet by using from mix of other pets but with new icons and descriptions.
I have issue that i can see my skills on my new pet but i cannot use them.


I did update this to db and client:SkillTreeResource,SkillJPResource,SkillStag e,SkillResource,StringResource and 02_item.spr

Could anyone tell me where might be issue?
03/23/2017 15:30 fumble2010#6237
Quote:
Originally Posted by Älucard View Post
I did update this to db and client:SkillTreeResource,SkillJPResource,SkillStag e,SkillResource,StringResource and 02_item.spr

Could anyone tell me where might be issue?
Hey did you check the Summon DB ? You need to set the skilltree IDs to your new pet / monster

But @[Only registered and activated users can see links. Click Here To Register...] might help you out since hes clearly more into it then iam :)


__________________
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

03/23/2017 18:15 アルカード#6238
Quote:
Originally Posted by fumble2010 View Post
Hey did you check the Summon DB ? You need to set the skilltree IDs to your new pet / monster

But @[Only registered and activated users can see links. Click Here To Register...] might help you out since hes clearly more into it then iam :)


__________________
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

as i say above i did all.I can see skills ingame but can't use it.
03/23/2017 20:10 ThunderNikk#6239
Quote:
Originally Posted by Älucard View Post
as i say above i did all.I can see skills ingame but can't use it.
Well in his defense you did not mention arcadia.dbo.summon or the rdb above.
03/23/2017 20:26 アルカード#6240
Quote:
Originally Posted by thndr View Post
Well in his defense you did not mention arcadia.dbo.summon or the rdb above.
Well my bad but i did
Rdb.skillresource,rdb.skilltreeresource,skilljpres ource.string,summon and item02.spr for icons