Jump to content
  • 0

QUESTION callfunc itemscript


PaqnaN

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   2
  • Joined:  01/06/14
  • Last Seen:  

Hi there guys.. hope you can help me with this one.

i made a custom card for accessories which has the callfucn script.

what this item can do is to FCP and SOUL LINK the players when they type "buff"

anywhere ingame even in pvp rooms and guild castles..

but here is my problem,

when you compound the card and equip the accessory, it will automatically execute the function script without even saying "buff".

and another problem is, other equips are affected by it, like when i equip/unequip another item such as head gears,armor, etc.. the function will also executes.

hope theres someone understand me and can help me.

thnx in advance.

Here is my item script

{callfunc "admin_blessing", 1;},{getitem 30049,1},{delitem 30049, 1;}
This is the function script.

function script admin_blessing {
 
Lquote1:
if (countitem(30049) < 1) {
dispbottom ""+strcharinfo(0)+", You are not blessed by Admin!";
end; 
} 
dispbottom "Here is your blessings!";
skilleffect 479,0;
sc_start SC_CP_WEAPON, 6000000, 5;
sc_start SC_CP_SHIELD, 6000000, 5;
sc_start SC_CP_ARMOR, 6000000, 5;
sc_start SC_CP_HELM, 6000000, 5;
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, 360000, 5, .@spirit,0,0;
  skilleffect .@spirit, 5;
}
end;
 
OnInit:
defpattern 1, "Buff", "Lquote1";
activatepset 1;

end;
}
Edited by Paxz
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   164
  • Joined:  08/17/13
  • Last Seen:  

shoudn't you add an "else" here?

line 5 to 7

  1. Lquote1:
  2. if (countitem(30049) < 1) {
  3. dispbottom ""+strcharinfo(0)+", You are not blessed by Admin!";
  4. end;
  5. } 
  6. else
  7. {
  8. dispbottom "Here is your blessings!";
  9. skilleffect 479,0;
  10. sc_start SC_CP_WEAPON, 6000000, 5;
  11. sc_start SC_CP_SHIELD, 6000000, 5;
  12. sc_start SC_CP_ARMOR, 6000000, 5;
  13. sc_start SC_CP_HELM, 6000000, 5;
  14. }
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   2
  • Joined:  01/06/14
  • Last Seen:  

hi kido.. thnx for the reply.

anyway, i try what you said but still the same.

what i really want is when you say buff, it will link and fcp the player

but to my script it will automaticall link and fcp the player when they wear it

+ when you wear another equip like armor,etc. it will also effect.

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