Jump to content

Question

8 answers to this question

Recommended Posts

Posted


OnNPCKillEvent:

.@party = getcharid(1);

.@map$ = strcharinfo(3);

if( .@party ){

addrid( 2,0,.@party );

if( HP > 1 && strcharinfo(3) == .@map$ ){

#CASHPOINTS += 20;

}

}

end;

Posted (edited)


-    script    test1234    -1,{

OnNPCKillEvent

    set .@pid,getcharid(1);

    if(!.@pid)end;

    setd("."+getcharid(1)+"m$",strcharinfo(3));

    addrid(2,0,.@pid);

    if(getd("."+getcharid(1)+"m$")==strcharinfo(3))

        set #CASHPOINTS,#CASHPOINTS+20;

    setd("."+getcharid(1)+"m$","");

end;

}

Edited by QQfoolsorellina
Posted (edited)

if(killedrid== mob classID ){ .....}

 

 

-    script    test1234    -1,{
OnNPCKillEvent:
    if(killedrid== mob classID ){
        set .@pid,getcharid(1);
        if(!.@pid)end;
        setd("."+getcharid(1)+"m$",strcharinfo(3));
        addrid(2,0,.@pid);
        if(getd("."+getcharid(1)+"m$")==strcharinfo(3))
            set #CASHPOINTS,#CASHPOINTS+20;
        setd("."+getcharid(1)+"m$","");
    }
end;
}
Edited by QQfoolsorellina
Posted (edited)

 @ Phantom Of Rogue-Gon

-    script    test1234    -1,{
OnNPCKillEvent:
    for(;.@i<.size;.@i++)
        if(killedrid== .cm[.@i])
            set .@f,1;
    if(!.@f) end;
    set .@pid,getcharid(1);
    if(!.@pid)end;
    set .map$,strcharinfo(3));
    addrid(2,0,.@pid);
    if( HP && .map$==strcharinfo(3))
        set #CASHPOINTS,#CASHPOINTS+20;
end;

OnInit:
    setarray .cm[0],1002; //put mob id here
    set .size,getarraysize(.cm);

}
 


 

@Emistry

OnNPCKillEvent:
.@party = getcharid(1);
.@map$ = strcharinfo(3);

if( .@party ){
	addrid( 2,0,.@party );
	if( HP > 1 && strcharinfo(3) == .@map$ ){
		#CASHPOINTS += 20;
	}
}
end;

 

 

.@  this type  of  var  will be  gone   when you  use  addrid    ,  so  strcharinfo(3) == .@map$  was wrong

Edited by QQfoolsorellina
  • Upvote 1
Posted
-    script    test1234    -1,{
OnNPCKillEvent:
    for(;.@i<.size;.@i++)
        if(killedrid== .cm[.@i])
            set .@f,1;
    if(!.@f) end;
    set .@pid,getcharid(1);
    if(!.@pid)end;
    set .map$,strcharinfo(3));
    addrid(2,0,.@pid);
    if( HP && .map$==strcharinfo(3))
        set #CASHPOINTS,#CASHPOINTS+20;
end;

OnInit:
    setarray .cm[0],1002; //put mob id here
    set .size,getarraysize(.cm);

}
 

 where can put the map i add 5 mobs and 3 type of cashpoint

cashpoint 20

cashpoint 50

cashpoint 100

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...