//@unloadnpc loginevent
//@loadnpc npc/thor/login.txt

-	script	loginevent	-1,{

OnInit:

/*************************************************************
 *                      Configuration                        *
 *************************************************************/
	.@ServName$ = "Classic Ragnarok Online (Thor)";
	setarray .announcements$, "Hope you're having fun on "+ .@ServName$+"!  We are currently running under EP 13.1 Ash Vacuum.",
		  "Type @commands to view a list of helpful tools to aid you in your adventure.",
		  "Enjoy playing the full features of the game.  Use your PC or Laptop to play. Download Installer at the website.",
		  "Avoid getting hacked, change your password regularly. Login-in only at www.classicro.net. ClassicRO will NOT entertain any HACK case anymore. It is YOUR resposibility to secure your account.",
		  "Protect your account, avoid getting hacked, use @security to secure your account with PIN and make sure to enable when logout.",
		  "Do you know? You will earning reward points to buy potions and cool stuffs while staying online.  Visit Online Gaming Time at the Head Office to claim.",
		  "Do you know? You can prevent anyone from kill stealing your mob? Type @noks to protect yourself or party.  This does not affect MvP and Mini Boss mobs.",
		  "Adding contact number, Whatsup or the like in vending or pub is a form of RMT. Please report abuse at fb.com/free2playasia/messages",
		  "Real Money Trading is NOT allowed INSIDE the game. We will automatically BLOCK account without notice.",
		  "Attempting to deceive a player such as scamming, and any other means of deceiving just to get the players item/zeny is a bannable offense. Please submit screenshot to fb.com/messages/classicro.net",
		  "Attempting to VEND NPC armors or items higher than NPC price is a form of scamming and is bannable.  Please submit screenshot to fb.com/free2playasia/messages",
		  "PERMA BAN will be imposed on Aggressive, harrassing use of names or titles thar are OFFENSSIVE or RACIST in nature.",
		  "REFERRAL SYSTEM: You can earn as much as 10,000 Credit by inviting your friend to play here at ClassicRO. Visit http://classicro.net/?module=referral for more info.",
		  "Checkout our Facebook Fan Page at https://facebook.com/Free2PlayAsia",
		  "Looking for party? use @sparty to find one. You may also shout to buy or sell items.  Use @buy or @sell.",
		  "Don't get lost, our website is packed with GUIDES you need to get going.",
		  "Don't waste your time, plan your stats and equipments.  You can simulate PvP and PvM damage using our online stat calculator at https://www.classicro.net/calc",
		  "Join our DISCORD Community. https://discord.gg/3SeRsPF or visit webiste for the link.",
		  "Join our FACEBOOK GROUP. https://www.facebook.com/groups/889873817827707 or visit webiste for the link.";
 	end;

OnAnnounce:

	announce .announcements$[rand(getarraysize(.announcements$))],bc_self;
	addtimer 300000,strnpcinfo(0) + "::OnAnnounce";
	end;


OnPCLoginEvent:
	//if ( getgmlevel() < 1) end;
	query_sql "SELECT `last_ip` FROM login WHERE `account_id` = "+ getcharid(CHAR_ID_ACCOUNT), .@last_ip$;
	//@is_mobile = ( .@last_ip$ == "139.99.102.101" );
	@is_mobile = ( .@last_ip$ == "188.166.223.216" );
	//@is_mobile = ( .@last_ip$ == "180.191.116.60" );
 	if (@is_mobile) {
		set #mobile,1;
	} else {
		set #mobile,0;
	}

	if ( !callfunc("F_CheckGuildMaster") && getequipid(EQI_HEAD_TOP) == CRO_Woe_Crown ) {
		unequip(EQI_HEAD_TOP);
	} 

	if(#mobile && getgmlevel() >= 1) end;
	// Announce
   	announce .announcements$[rand(getarraysize(.announcements$))],bc_self;
    	addtimer 300000,strnpcinfo(0) + "::OnAnnounce";
	end;

}

