-
[release] TimerItem method
find this
NPCConversationManager.java
add this import
import net.sf.odinms.server.TimerManager;
import net.sf.odinms.server.MapleInventoryManipulator;
import net.sf.odinms.client.MapleInventoryType;
add this method
Quote:
public void personItem(final int id, final short quantity, final byte type, int time) {
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
StringBuilder logInfo = new StringBuilder(c.getPlayer().getName());
logInfo.append(" received ");
logInfo.append(quantity);
logInfo.append(" from a scripted PlayerInteraction (");
logInfo.append(this.toString());
logInfo.append(")");
MapleInventoryManipulator.addById(c, id, quantity, logInfo.toString());
c.getSession().write(MaplePacketCreator.getShowItemGain(id, quantity, true));
}
}, 0); // start
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
MapleInventoryManipulator.removeById(c, MapleInventoryType.getByType(type), id, quantity, true, false);
c.getPlayer().getClient().getSession().write(MaplePacketCreator.serverNotice(1, "remove Item"));
}
}, time * 1000); // ? second late
}
EX / cm.personItem(code, quantity, inventorytype, time);
it is made by ReturnSSI(c92h23)
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
Nice? what exactly is it?
-
Re: [release] TimerItem method
was wonder about that myself
-
Re: [release] TimerItem method
it is something like a item that will auto gone in when reach the deadline?
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
what does it do? : It deletes a certain item after a certain amount of time. Like a quest item in a PQ.
-
Re: [release] TimerItem method
Oh Like the Nx Iteam They Have a 3 month period
Ew GMS LIKE!
-
Re: [release] TimerItem method
Cool! this could be useful.
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
The time is in whad format? milliseconds, seconds, mins or hours? @_@
Btw, this is nice.
-
Re: [release] TimerItem method
Quote:
Originally Posted by
EspadaFung
show us a npc script.
Someone doesn't know much about Java.
You don't NEED an NPC Script.
Why? This is like gMS.
When you buy an NX item, it disappears after 3 months right?
So, this is like gMS, except with any item you want.
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
Quote:
Originally Posted by
HydroBenZ
Someone doesn't know much about Java.
You don't NEED an NPC Script.
Why? This is like gMS.
When you buy an NX item, it disappears after 3 months right?
So, this is like gMS, except with any item you want.
you seem to be the one who doesn't know much about java. you DO need an npc script. you use an npc to spawn an item with deadline for the players. normal items don't affect only the item spawned by the player.
@bendanx3 its in milliseconds.
Quote:
}, time * 1000); // ? second late
Anyway, great job thread starter. From reading, you seem to be missing a bracket though.
-
Re: [release] TimerItem method
-
Re: [release] TimerItem method
it won't work... because all it does is creat a timer. it isnt saved in the database so it'll never work... you need to save it in the db...
-
Re: [release] TimerItem method
Quote:
Originally Posted by
HydroBenZ
Someone doesn't know much about Java.
You don't NEED an NPC Script.
Why? This is like gMS.
When you buy an NX item, it disappears after 3 months right?
So, this is like gMS, except with any item you want.
lols noob.
why is he adding it in the NPCConversationManager.java if it's not needed any npc script?
and, xazerrx, u know how is it actually functioning?
i just left my server yesterday and i won't bother adding it in for now. >.>
show me a simple script :D
-
Re: [release] TimerItem method
Code:
var pqticketid;
function start() {
cm.sendSimple("Wanna do the pq ? \r\n#L1#Yes#l\r\n#L2#No#l");
function action(mode, type, selection) {
if (selection == 1)
cm.personItem(pqticketid, 1, etc, 1000*60*60);
cm.dispose();
else
cm.sendOk("See you next time.");
}
}
cm.personItem used in this format : cm.personItem(code, quantity, inventorytype, time);
-
Re: [release] TimerItem method
Quote:
Originally Posted by
xazerrx
Code:
var pqticketid;
function start() {
cm.sendSimple("Wanna do the pq ? \r\n#L1#Yes#l\r\n#L2#No#l");
function action(mode, type, selection) {
if (selection == 1)
cm.personItem(pqticketid, 1, etc, 1000*60*60);
cm.dispose();
else
cm.sendOk("See you next time.");
}
}
cm.personItem used in this format : cm.personItem(code, quantity, inventorytype, time);
No... type is byte...
etc = 4
cm.personItem(pqticketid,1,4,1000*60*60);
-
Re: [release] TimerItem method
oh yeah didn't read it properly. you should put my script example there :P
-
Re: [release] TimerItem method
uhh, eq = 1
use = 2
setup = 3
etc = 4
and cash = 5
i see. :X
-
Re: [release] TimerItem method
uhh, i just added those import, and i wonder is this work for version 55?
im very sure i did nothing's wrong with it. >.>
-
Re: [release] TimerItem method
Quote:
Originally Posted by
EspadaFung
uhh, i just added those import, and i wonder is this work for version 55?
im very sure i did nothing's wrong with it. >.>
Yes its fully compatible with v55. If you have no compiling errors, means its your npc script.