Jump to content
  • 0

Housing system problem


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  


Phantasia,95,98,5 script Home Owner 100,{
if (.bought == 1) goto L_Bought;
mes "[Home Helper]";
mes "Please pick an option!";
menu "Buy!",-,"Cancel",L_Cancel;
next;
mes "That'll be [ 10,000 ] Phantasm Coins.";
menu "Okay",-,"Nevermind",L_Cancel;
next;
if (countitem(7539) > 10000) goto L_Cancel;
delitem 7539,10000;
set .charID$, strcharinfo(0);
set .bought,1;
mes "Congratulations!";
mes "You have a home!";
close;

L_Bought:
if (.others == 1) goto L_OtherWarp;
if (.charID$ != strcharinfo(0)) goto L_Exit;
mes "[Home Helper]";
mes "How may I help you "+ strcharinfo(0) +"?";
menu "Warp Inside",L_Warp,"Abandoned House?",L_Sell,"Nevermind",L_Cancel;

L_Sell:
mes "[Home Helper]";
mes "You are sure about this?";
menu "Yes!",-,"No!",L_Cancel;
next;
set .charID$, Nobody;
set .bought, 0;
set .others, 0;
mes "Done!";
close;


L_OtherWarp:
if (.charID$ != strcharinfo(0)) goto L_Warp;
mes "[Home Helper]";
mes "How may I help you "+ strcharinfo(0) +"?";
menu "Warp Inside",L_Warp,"Abandoned House?",L_Sell,"Nevermind",L_Cancel,"Allow Others To Enter",L_others,"Do Not Allow Others To Enter",L_me;

L_Warp: warp "house_inn.gat",42,28;
end;

L_Exit:
mes "[Home Helper]";
mes "Not the Owner.";
mes "I only help ["+ .charID$ +".]";
close;

L_Cancel:
close;
}


//*********************************************//
- script Helper2x::hexor -1,{
mes "[Maid]";
mes "What can i do for you ma'am and sir?";
next;
menu "> Heal",L_Heal,"> Buffs",L_Buf,"> Soul Link",L_Soul,"> Storage",L_sto,"> Invite a player",L_others;

L_Soul:
mes "You want me to Soul Link you?";
switch(select("Yes:No")) {
case 1:
switch ( basejob ) {
case Job_Alchemist: set .@spirit, 445; break;
case Job_Monk: set .@spirit, 447; break;
case Job_Star_Gladiator: set .@spirit, 448; break;
case Job_Sage: set .@spirit, 449; break;
case Job_Crusader: set .@spirit, 450; break;
case Job_SuperNovice: set .@spirit, 451; break;
case Job_Knight: set .@spirit, 452; break;
case Job_Wizard: set .@spirit, 453; break;
case Job_Priest: set .@spirit, 454; break;
case Job_Bard: case Job_Dancer: set .@spirit, 455; break;
case Job_Rogue: set .@spirit, 456; break;
case Job_Assassin: set .@spirit, 457; break;
case Job_Blacksmith: set .@spirit, 458; break;
case Job_Hunter: set .@spirit, 460; break;
case Job_Soul_Linker: set .@spirit, 461; break;
default:
if ( upper == 1 && baselevel < 70 )
set .@spirit, 494;
}
if ( .@spirit ) {
sc_start4 sc_spirit, .@time, 5, .@spirit,0,0;
skilleffect .@spirit, 5;
}

case 2:
mes .@n$;
mes "Okay,goodbye!";
close;
}


L_heal:
percentheal 100,100;
specialeffect2 548; // Red for an instant
close;

L_buf:
sc_start SC_BLESSING,.duration,10; // Blessing lvl 10
sc_start SC_INCREASEAGI,.duration,10; // Increase agi lvl 10
sc_start SC_CP_HELM,600000,5;
sc_start SC_CP_SHIELD,600000,5;
sc_start SC_CP_ARMOR,600000,5;
sc_start SC_CP_WEAPON,600000,5;
sc_start SC_ASSUMPTION,60000,5;
close;

L_sto:
close2;
openstorage;
end;


L_others:
mes "[Home Helper]";
mes "Input the correct name of the player you want to invite";
next;
input(.@qx$);
if(getcharid(0,.@qx$)){
warpchar strcharinfo(3),42,29,getcharid(0,.@qx$);
mes "complete";
}else{
mes "Error!";
}
close;
}
house_inn,48,30,3 duplicate(hexor) Maid 112
house_inn1,48,30,3 duplicate(hexor) Maid#1 112
house_inn2,48,30,3 duplicate(hexor) Maid#2 112
house_inn3,48,30,3 duplicate(hexor) Maid#3 112
house_inn4,48,30,3 duplicate(hexor) Maid#4 112

house_inn,42,25,0 warp Bh2 1,1,Phantasia,91,101
house_inn1,42,25,0 warp Bh2 1,1,Phantasia,146,99
house_inn2,42,25,0 warp Bh2 1,1,Phantasia,158,129
house_inn3,42,25,0 warp Bh2 1,1,Phantasia,33,14
house_inn4,42,25,0 warp Bh2 1,1,Phantasia,24,41

house_inn mapflag nowarpto
house_inn1 mapflag nowarpto
house_inn2 mapflag nowarpto
house_inn3 mapflag nowarpto
house_inn4 mapflag nowarpto

how can i fix this when i reloadscript the player who bought it remove to her ownership ?

Edited by Arcenciel
Codeboxed
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Turn all the NPC variables (.var) into either permanent character variables (definitely the more efficient method, but will require some work) or permanent global variables (if you have many houses, do not do this).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

how? can i change it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Read: http://rathena.org/wiki/Variables

Character variables: no prefix

Global variables: $ prefix

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

Read: http://rathena.org/wiki/Variables

Character variables: no prefix

Global variables: $ prefix

so it will loook like this?


set @charID$, strcharinfo(0);

bump!

Edited by bVersatile
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...