Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Reviving item.

Junior Spellweaver
Joined
Oct 15, 2008
Messages
188
Reaction score
0
Whats up RageZone. Haven't been here in a long time. My java's gone slightly cocky too. Here's something small that I thought would be cool.

In MapleCharacter.java :
Search :
Code:
private void playerDead() {
Right under, add :
Code:
if (getItemQuantity(3995000, false) >= 1) {
            NPCScriptManager.getInstance().start(getClient(), [B][U]YOURNPCIDHERE[/U][/B]);
Add import :
Code:
import net.sf.odinms.scripting.npc.NPCScriptManager;

Place this into any npc you want :
Code:
/**
*@author - AceEvolution
*/
importPackage(net.sf.odinms.client);
var status = 0;



function start() {
    status = -1;
    action(1, 0, 0);
}


function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (status >= 2 && mode == 0) {
        cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendYesNo("You have just died, but since you possess the reviving item, you will be given a choice to be revived. Would you like to be revived?");
 }
		else if (status == 1) {
			cm.gainItem(3995000, -1);
			cm.getChar().setHp(cm.getChar().getMaxHp());
			cm.dispose();
		}
		else {
			cm.dispose();
		}
		}
		}

Enjoy. The item is some useless item that is unstackable so players cant possess too much of it (it is also untradable).
 
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
not bad
wont the npc error with the 'you have died' message though?
 
Divine Celestial
Loyal Member
Joined
Jul 19, 2008
Messages
830
Reaction score
2
Is it a potion you eat when you die to revive yourself? o_O
 
Master Summoner
Loyal Member
Joined
Jul 22, 2008
Messages
573
Reaction score
0
@xblaze

it'll check for item 3995000
if you have it then the npc will pop out.

and the npc will -3995000 and revive u.
 
Junior Spellweaver
Joined
Oct 15, 2008
Messages
188
Reaction score
0
not bad
wont the npc error with the 'you have died' message though?
actually im not really sure. i'll have it tested. if that be the case then i'll just have it removed with no notice like how a charm works. Grats on mod btw.
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
not bad
wont the npc error with the 'you have died' message though?

The die MSG and the pop up I believe are kinda the same, So i doubt it does case any crash.


Trough you quitted AcE, Welcome Back :)
 
Back?
Loyal Member
Joined
Apr 17, 2008
Messages
540
Reaction score
19
nice job acevo bummer you left and lol at your sig osiris
 
Custom Title Activated
Loyal Member
Joined
Oct 3, 2008
Messages
1,938
Reaction score
3
this is real nice,
and useful,
its actually pretty creative too
 
Junior Spellweaver
Joined
Oct 15, 2008
Messages
188
Reaction score
0
back and tested. it won't crash and theres no nid for enableActions since the npc is disposed.
The die MSG and the pop up I believe are kinda the same, So i doubt it does case any crash.


Trough you quitted AcE, Welcome Back :)
hehe ty. only back for a while ;P
 
Experienced Elementalist
Joined
May 5, 2008
Messages
219
Reaction score
0
n1 sufi didi :D
i thought we nvr had this finished that time , and u went to msea alr. =/
Anyway , nice release. Free chat with me on msn ok :D
 
Back
Top