Jump to content
  • 0

Dispel on Changing Maps


Question

Posted

Hi ! ive created a script that will dispel specific buffs on changing maps .. its working fine until I upgraded to latest Rathena .. I dont know why ? or maybe my SQL script is outdated ? I dont know ..Please help me thankyou 

-    script    dispell_buff    -1,{


OnPCLoadMapEvent:
.@map$ = strcharinfo(3);
query_sql ("SELECT `last_map` FROM `char` WHERE `char_id` = "+ getcharid(0), .lastmap$);
    if (.@map$ == .lastmap$) { 
        getmapxy(.map$,.x,.y,BL_PC);
        end;
    }
    else {
        //sleep2 1000;
        query_sql "UPDATE `char` SET `last_map` = '"+escape_sql(.@map$)+"' WHERE `char_id` = '"+getcharid(0)+"'";
    
        //sc_end sc_spirit;
        sc_end sc_gospel;
        sc_end SC_POEMBRAGI;
        sc_end SC_APPLEIDUN;
        sc_end SC_ASSNCROS;
        sc_end SC_WHISTLE;
        sc_end SC_SERVICE4U;
        //sc_end 37; // holy weapon
        //sc_end 38; // holy armor
        sc_end 187; // increase all stat
        sc_end 194; // increase hit
        sc_end 196; // increase flee
        sc_end 198; // max hp increase
        sc_end 199; // max sp increase
        sc_end 200; // attach strength
        sc_end 202; // increase def    
        sc_end 214; // SC_SCRESIST
        sc_end 175; // POEMBRAGI
        sc_end 181; // SERVICE4U
        specialeffect2 235;
        getmapxy(.map$,.x,.y,BL_PC);
        end;
    }    
         
}

 

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

The reason that it isn't working is because of the variables on that code.
Here's the simplified code for that.

EDIT: This code won't work on maps without loadevent flags

-	script	rmvbuff	-1,{

OnPCLoadMapEvent:
	if(@rmvmap$ == strcharinfo(3)) end;
	//sc_end sc_spirit;
	sc_end sc_gospel;
	sc_end SC_POEMBRAGI;
	sc_end SC_APPLEIDUN;
	sc_end SC_ASSNCROS;
	sc_end SC_WHISTLE;
	sc_end SC_SERVICE4U;
	//sc_end 37; // holy weapon
	//sc_end 38; // holy armor
	sc_end 187; // increase all stat
	sc_end 194; // increase hit
	sc_end 196; // increase flee
	sc_end 198; // max hp increase
	sc_end 199; // max sp increase
	sc_end 200; // attach strength
	sc_end 202; // increase def	
	sc_end 214; // SC_SCRESIST
	sc_end 175; // POEMBRAGI
	sc_end 181; // SERVICE4U
	specialeffect2 235;
	@rmvmap$ = strcharinfo(3);
	end; 
}
Edited by Haruka Mayumi
  • 0
Posted
4 hours ago, Eross said:

Hi ! ive created a script that will dispel specific buffs on changing maps .. its working fine until I upgraded to latest Rathena .. I dont know why ? or maybe my SQL script is outdated ? I dont know ..Please help me thankyou 

-    script    dispell_buff    -1,{


OnPCLoadMapEvent:
.@map$ = strcharinfo(3);
query_sql ("SELECT `last_map` FROM `char` WHERE `char_id` = "+ getcharid(0), .lastmap$);
    if (.@map$ == .lastmap$) { 
        getmapxy(.map$,.x,.y,BL_PC);
        end;
    }
    else {
        //sleep2 1000;
        query_sql "UPDATE `char` SET `last_map` = '"+escape_sql(.@map$)+"' WHERE `char_id` = '"+getcharid(0)+"'";
    
        //sc_end sc_spirit;
        sc_end sc_gospel;
        sc_end SC_POEMBRAGI;
        sc_end SC_APPLEIDUN;
        sc_end SC_ASSNCROS;
        sc_end SC_WHISTLE;
        sc_end SC_SERVICE4U;
        //sc_end 37; // holy weapon
        //sc_end 38; // holy armor
        sc_end 187; // increase all stat
        sc_end 194; // increase hit
        sc_end 196; // increase flee
        sc_end 198; // max hp increase
        sc_end 199; // max sp increase
        sc_end 200; // attach strength
        sc_end 202; // increase def    
        sc_end 214; // SC_SCRESIST
        sc_end 175; // POEMBRAGI
        sc_end 181; // SERVICE4U
        specialeffect2 235;
        getmapxy(.map$,.x,.y,BL_PC);
        end;
    }    
         
}

 

have u tried sc_end SC_ALL;

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