Jump to content
  • 0

Enchant mid


Tupac

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.02
  • Content Count:  101
  • Reputation:   5
  • Joined:  12/04/16
  • Last Seen:  

i modified this script:

//---------Favor Não retirar os Créditos----------------------------//
//------------------Filipesaj-------------------------------------------------//
//-------------------------------------------------------------------------------//

prontera,147,170,5	script	Brosnan	794,{
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Sou um encantador profissonal!";
mes "Posso ativar as pedras secretas de encantamento no seu item.";
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Quanto maior a raridade do encantamento, melhores serão seus bônus.";
next;
switch(select("[^339966+^000000]Encantar.:[^FF0000-^000000]Informações."))

{
case 1:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Em qual Slot deseja encantar o seu equipamento?";
mes "^FF0000Apenas o slot 4 é encantavel.^000000";
input @encan;
if(@encan>=5) goto maiorque4;
if(@encan==4) goto iguala4;
if(@encan==3) goto iguala3;
if(@encan==2) goto iguala2;
if(@encan==1) goto iguala1;
if(@encan==0) goto iguala0;
close;
OnInit:
waitingroom "Desativado até manutenção",0,"",0;
end;

case 2:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "^0000FFEncantamento^000000";
mes "Necessário: <ITEM>Ticket encantamento<INFO>7717</INFO></ITEM>";
mes "Que Pode ser obtidos:";
mes "- ^FF0000Cash Shop^000000";
mes "- ^FF0000Eventos^000000";
close;
end;
}

iguala4:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Tem certeza que deseja encantar sua armadura no slot número 4?";
switch(select("[^339966+^000000]Sim.:[^FF0000-^000000]Não."))
{
case 1:
if (countitem(7717)<1) {
set .@item, getequipid(EQI_HEAD_MID);
set .@rand_bonus, rand(4700,4759);
set .@refine, getequiprefinerycnt(EQI_HEAD_MID);
set .@cardid, getequipcardid(EQI_HEAD_MID,0);
set .@cardid1, getequipcardid(EQI_HEAD_MID,1);
set .@cardid2, getequipcardid(EQI_HEAD_MID,2);
if(getequipisequiped(EQI_HEAD_MID)==0)goto noarmo;
unequip EQI_HEAD_MID;
delitem 7717,1;
delitem .@item,1;
mes "Encantado com Sucesso: "+getitemname(.@rand_bonus);
getitem2 .@item,1,1,.@refine,0, .@cardid, .@cardid1, .@cardid2, .@rand_bonus;
specialeffect2 454;
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Parabéns, Seu item foi encantado com Sucesso!";
close;
}
end;

case 2:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Volte quando quizer!";
close;
end;
}



iguala3:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Desculpe, mas ainda não foi descoberto como encantar no Slot 1.";
mes "Dizem que esse encantamento é uma lenda!";
close;
end;

iguala2:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Desculpe, mas ainda não foi descoberto como encantar no Slot 1.";
mes "Dizem que esse encantamento é uma lenda!";
close;
end;

iguala1:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Desculpe, mas ainda não foi descoberto como encantar no Slot 1.";
mes "Dizem que esse encantamento é uma lenda!";
close;
end;

iguala0:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Não existe Slot 0!";
close;
end;

maiorque4:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Não existe Slot maior que 4!";
close;
end;

noitem:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Você não tem o item necessário para realizar o procedimento.";
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Item Necessário: ^339966Ticket Encantamento^000000.";
close;

noarmo:
next;
mes "^FF0000["+strnpcinfo(1)+"]^000000";
mes "Você não esta usando ^339966Armadura^000000.";
close;
}

if (countitem(7717)<1)

Require item id: 7717

Error enchant map_server:

[Error]: buildin_delitem: failed to delete 1 items (AID=2000001 item_id=7717).
[Debug]: Source (NPC): Brosnan at prontera (147,170)

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

if (countitem(7717)<1)
to
if(countitem(7717) > 0)

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Also move you're check for equipped gear above the variables. Doesn't make sense to check for equipped item after saving the values into variables.

See my armor enchanter for reference as example: 

https://github.com/llchrisll/rAthena-Scripts/blob/master/released/Utility/armor_enchant.txt

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