Jump to content
  • 0

Dispel on Changing Maps


Eross

Question


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.10
  • Content Count:  349
  • Reputation:   12
  • Joined:  04/05/20
  • Last Seen:  

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;
    }    
         
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1599
  • Reputation:   246
  • Joined:  08/03/12
  • Last Seen:  

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;

Link to comment
Share on other sites

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.

×
×
  • Create New...