Jump to content

[Share] Newbie Gift Command


eKo

Recommended Posts

Sup, i share a Newbiegift command, a friend of Mine Requested it. So i was Thinking maybe someone of you find it usefull.

Its nothing special nothing hard to do, but i know there some people that cant code such simple codes so i Share it.

 

Index: C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/handler/voicedcommandhandlers/newbiegift.java
===================================================================
--- C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/handler/voicedcommandhandlers/newbiegift.java	(revision 0)
+++ C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/handler/voicedcommandhandlers/newbiegift.java	(revision 0)
@@ -0,0 +1,61 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package lt.equal.gameserver.handler.voicedcommandhandlers;
+
+import lt.equal.gameserver.handler.IVoicedCommandHandler;
+import lt.equal.gameserver.model.actor.instance.L2PcInstance;
+import lt.equal.util.Rnd;
+
+/**
+*
+* @author eko
+*/
+public class newbiegift implements IVoicedCommandHandler
+{
+	private static final String[] VOICED_COMMANDS = { "newbiegift" };
+	   
+public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+{
+	if (command.equalsIgnoreCase("newbiegift"))
+	{
+		if (activeChar.getLevel() >= 1 && activeChar.isNewbie())
+		{
+			activeChar.sendMessage("You are allready Used that Command.");
+			return true;
+		}
+		else if (activeChar.getInventory().getItemByItemId(3434).getCount() >= 1)
+		{
+			activeChar.getInventory().destroyItemByItemId("newbiegift", 3434, 1, activeChar, activeChar.getTarget());
+			// {ItemID, Item Ammount}
+    		int[][] items = { {8557, 1}, {8184, 1}, { 8187, 1}, { 8552, 1}, { 8185, 1}, { 8563, 1}, { 8562, 1}, { 8561, 1}, { 8560, 1} };
+            // How many Items Aviable on the List
+    		int[] ar = items[Rnd.get(9)];
+    		activeChar.addItem(command,  ar[0], ar[1], activeChar, true);
+			activeChar.sendMessage("You Recived a Newbiegift!");
+            activeChar.broadcastUserInfo();
+		}
+		else
+		{
+			activeChar.sendMessage("Missing Coke to Create your Gift.");
+			return true;
+		}
+	}
+	return false;
+}
+public String[] getVoicedCommandList()
+{
+	return VOICED_COMMANDS;
+}
+}
\ No newline at end of file
Index: C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/network/clientpackets/EnterWorld.java	(revision 206)
+++ C:/Dokumente und Einstellungen/michael/workspace2/Equal-GameServer/java/lt/equal/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -189,10 +184,14 @@
+		if (activeChar.getLevel() >= 1 && activeChar.isNewbie() && activeChar.getInventory().getItemByItemId(3436) == null)
+		{
+			activeChar.addItem("loot", 3434, 1, activeChar, true);
+		}

the Code Allows newbieplayers to Recive a small gitft, atm its set to 9 Random items as gitft(demon horns,party hat,blue party hat,feathered hat etc.)

the item will be choosen Randomly

 

HF & GL

 

Note: no flame plix i know its a simple code i explained above why i shared it

Link to comment
Share on other sites

but what is the voice command type? .?

 

type .newbiegift and you revice a random Accessorie

Useable only when you are a Newbie lvl 1 and have the item 3434 wich is Coke

 

on enter world i gives you the item if you are a newbie your lvl is 1 and you dont have the item in your inventory

Link to comment
Share on other sites

and that command just give's newbie characters items?

 

why i need command if i just use customstartingitems ?

 

first. customstarting items is for everyone not only newbies, second its a randomly chosen reward

you can add unlimited items to it, such as adena,items,Hair Accessories,Scrolls etc.

Link to comment
Share on other sites

first. customstarting items is for everyone not only newbies, second its a randomly chosen reward

you can add unlimited items to it, such as adena,items,Hair Accessories,Scrolls etc.

what you mean custumstartingitems are not only for newbies? :D

custom starting items you have only once!

 

and i have add 29 items in custom starting items so i think is unlimited too

Link to comment
Share on other sites

what you mean custumstartingitems are not only for newbies? :D

custom starting items you have only once!

 

and i have add 29 items in custom starting items so i think is unlimited too

 

are the items randomly choosen? i think not. you dont have to Bitch around because i flamed you for making 3213 topics whit c/p codes that werent yourself just to gain some praise from other people

Link to comment
Share on other sites

+1 karma from me.

and thanks i need smth like this.

thanks again :)

i wonder why today some ppls increase the karma so eazy...

by the way

@eKo its nice share thanks you :)

Link to comment
Share on other sites

i wonder why today some ppls increase the karma so eazy...

by the way

@eKo its nice share thanks you :)

 

haha, i was thinking the same didnt expect a +1 karma from that share

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...