Jump to content
  • 0

Question

Posted

Okay, i want to modify this part a little bit from annieruru's devil square.


Ondevil4:
.round = 4;
.mob = 10;
monster "ordeal_1-1",231,250,"Treasure Box",1324,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",234,247,"Treasure Box",1328,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",237,244,"Treasure Box",1332,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",240,241,"Treasure Box",1336,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",243,238,"Treasure Box",1340,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",246,235,"Treasure Box",1344,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",249,232,"Treasure Box",1348,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",252,229,"Treasure Box",1352,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",249,241,"Treasure Box",1356,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",240,249,"Treasure Box",1360,1,strnpcinfo(0)+"::Onboxdead";
end;

Onboxdead:
.mob--;
announce "Devil Square : "+ strcharinfo(0) +" has opened the treasure box at Devil Square", bc_all;
if ( !.mob )
goto L_End;
end;

So, i want that at randomly one of these treasure boxes will give a special reward to the surviving players when they kill it.

how can that be?

3 answers to this question

Recommended Posts

Posted
Ondevil4:
.round = 4;
.mob = 10;
.rn = ran(10);// add
monster "ordeal_1-1",231,250,"Treasure Box",1324,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",234,247,"Treasure Box",1328,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",237,244,"Treasure Box",1332,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",240,241,"Treasure Box",1336,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",243,238,"Treasure Box",1340,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",246,235,"Treasure Box",1344,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",249,232,"Treasure Box",1348,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",252,229,"Treasure Box",1352,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",249,241,"Treasure Box",1356,1,strnpcinfo(0)+"::Onboxdead";
monster "ordeal_1-1",240,249,"Treasure Box",1360,1,strnpcinfo(0)+"::Onboxdead";
end;

Onboxdead:
.mob--;
announce "Devil Square : "+ strcharinfo(0) +" has opened the treasure box at Devil Square", bc_all;

if(.mob == .rn){//add
 getitem 501,1;// to specify what item  surviving player will receive
}

if ( !.mob )
goto L_End;
end;

Posted (edited)

You forgot a 'd' in

 

 

.rn = ran(10);// add
 

also rand(10) give a number between 0 and 9

.rn = rand(1,10);// add
 
Edited by Capuche

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...