Jump to content

  •  

Zephy

Member Since 09 Jun 2013
Offline Last Active Jan 27 2014 04:27 AM
*****

Posts I've Made

In Topic: countitem loop

04 January 2014 - 05:39 PM

Damn this is pissing me off. For some reason when I try to use my script it says that my player is not attached. Eeff it, here's the actual script.

 

prontera,155,150,3	script	TEST_NPC1	99,{	// Loop to check if player has the required items	for(.@i = 0; .@i < getarraysize(.qitem[0]); .@i++)	{		if(countitem(.qitem[.@i] >= .qamt)		{			mes .npc_name$;			mes "congrats dialogue for gather items.";						delitem .qitem[.@i],.qamt;			getitem .pitem,.pamt;						close;		}	}	// Dialogue if player does NOT have the required items already	mes .npc_name$;	mes "dialogue hereeeee.";	mes "More hereeeee";	next;		mes .@player_name$;	mes "PC dialogue here";	next;		if(select("Yes, please.:No, thank you.") == 2)	{		mes .npc_name$;		mes "leaving message here";		close;	}	mes .npc_name$;	mes "more dialogue";	next	mes .npc_name$;	mes "Come back with:";		// List items	for(.@i = 0; .@i < getarraysize(.qitem[0]); .@i++)		mes "^FF0000"+ .qamt +"x - "+ getitemname(.qitem[.@i]) +"^000000";			mes "...and I will give you the item.";	close;OnInit:	// Configuration		// General		.npc_name$ = "[^008800NPC_NAME^000000]"; // NPC's dialogue name		.@player_name$ = "[^FF0000"+strcharinfo(0)+"^000000]";		// Items		.pitem = 901; // Prize item for completing the quest		.pamt = 1; // Prize item amount		setarray .qitem[0], 501, 502, 503;		.qamt = 1; // Quest item amount			end;}

 

 

 

 

 

 

 

I guess I should mention that I'm getting this strange error as well, even though I don't have that in my script ._. .

[Error]: npc_read_event_script: detected possible use of wrong case in a script. Found '::OnPcLoginEvent', probably meant to be '::OnPCLoginEvent' (in 'OnPCLoginEvent').

In Topic: countitem loop

04 January 2014 - 04:06 AM

I don't think that's it because I have the same loop to print out the requirements and its...

 

for(set .@i, 0; .@i <= getarraysize(.item[0]); .@i++)mes ^FF0000"+ .amt +"x -"+ getitemname(item[0]) +"^000000^";

 

...and it prints all the items out correctly.

 

 

EDIT: I think that whoever said a character was not attached was right. When I looked at the emulator (before changing the code) it kept giving me an error that the player was not attached (which is weird since the player has to initiate the script by talking to the NPC). The only real problem I saw with that was that it wasn't displaying the '.@player_name$' variable. So I changed the code to remove the error from the emulator (e.g. take out the '.@player_name$' variable). I'll keep messing around with it, especially since Nameless2you said the syntax was correct and it worked. 

 

Thanks everyone :x.


In Topic: countitem loop

04 January 2014 - 01:18 AM

Sorry :x. This was just a theoretical "snippet" from that script so you could get an idea of the loop. In the original one all variables are declared under 'OnInit'. However, it still does not work.


In Topic: Can anyone make a script like this

10 December 2013 - 04:08 AM

Uh, okay ill try to do it tomorrow.


In Topic: Can anyone make a script like this

09 December 2013 - 10:28 PM

Do you want it to be a physical NPC (a player can click on it) or do you want it to be automatic (when a player kills a multiple of 5 MVPs on a certain map, automatically gain the items)?

 

Here is a script that will do the latter :x...

 

/*=========================================================Untitledby Zephy===========================================================Description:No description available.===========================================================Compatibility:Optimised for Hercules emulators.===========================================================Changelog:1.0 - Initial release.===========================================================Additional Notes:	- If you want the kills to be reset when 	  the player dies, uncomment line 44 and 52.	 	- Currently the kill counter variable (@mvpkill)	  is a temporary variable, meaning that if the	  player logs out, their score will reset. If	  you want them to keep the score even when they	  log out, remove the '@' in @mvpkill.=========================================================*/-	script	MvP Counter	-1,{OnNPCKillEvent:	for (.@i = 0; .@i < getarraysize(.map$); .@i++)	{		if (getmonsterinfo(killedrid, MOB_MVPEXP) && strcharinfo(3) == .map$[.@i]) // Checks if user has killed an MvP on a specified map		{			@mvpkill++; //Increments variable to count MvP kills		}				if (@mvpkill % 5 == 0) // Checks if @mvpkill if a multiple of 5		{			@amount++; // Increment variable for prize amount (increment by 1 per 5 kills)			getitem .prize, @amount; // Gives player the prize		}	}end;/*OnPcDieEvent:	if (@mvpkill)	{		@mvpkill = 0;			}end;*///ConfigurationOnInit:	.prize = 0; // Prize ID	setarray .map$[0], "bossnia_01", "bossnia_02"; // Maps that you want this script active on	end;}