Page 1 of 1

Help Me please (095 version)

Posted: Mon Aug 14, 2006 3:11 pm
by MaximuS
Kind time of day. At me is a couple of questions. You could not help me with a script. The idea of a script is very simple. At presence of guild it is possible to make a portal in which the member of guild can come only... And so a problem: the portal opens, but come into him somebody cannot. In what there can be a problem? In advance thanks for the help. Here a script->

Code: Select all

use os;
use uo;
use cfgfile;

include "include/objtype";
include "include/client";
include "include/canAccess";

Program guildportal(who, text)
  if (!text)
    SendSysMessage(who, "You must specify the guild ID.");
    SendSysMessage(who, "You can get the guilds list by typing '.guildlist' command.");
    return;
  EndIf

  var stone:=0, guilds := ListGuilds();
  var guild_id := CInt(text);

  If (guilds.size() == 0)
    SendSysMessage(who, "There is no guilds. Sorry guys. :)");
    return;
  Else
    foreach guild in guilds
      if (guild.guildid==guild_id)
        stone:=guild;
        break;
      endif;
    endforeach
    If (!stone)
      SendSysMessage(who, "Guild with given ID (" + guild_id + ") is not exists!");
      return;
    EndIf
  EndIf
  SendSysMessage(who, "Creating portal for guild " + stone.getprop("guildname") + "...");
  SendSysMessage(who, "Target a recall rune to create portals.");



  var rune := Target(who);
  if((rune.objtype != UOBJ_RUNE) && (rune.objtype != 0x6100))
    SendSysMessage(who, "You must target recall rune!");
    return;
  endif
  var tox := CInt(GetObjProperty( rune, "x" ));
  var toy := CInt(GetObjProperty( rune, "y" ));
  var toz := CInt(GetObjProperty( rune, "z" ));
  if(!tox)
    SendSysMessage(who, "the rune must be marked.");
    return;
  endif

  var wx := who.x;
  var wy := who.y;
  var wz := who.z;

  set_critical(1);
  var gate1 := CreateItemAtLocation( wx, wy, wz, UOBJ_GUILD_PORTAL, 1 );
  gate1.movable := 0;
  gate1.decayat := 604;
  gate1.SaveOnExit := 1;
  var gate2 := CreateItemAtLocation( tox, toy, toz, UOBJ_GUILD_PORTAL, 1 );
  gate2.movable := 0;
  gate2.decayat := 604;
  gate2.SaveOnExit := 1;
  if(!gate1)
    DestroyItem(gate2);
    SendSysMessage(who, "Unable to create source gate");
    return;
  endif
  if (!gate2)
    DestroyItem(gate1);
    SendSysMessage(who, "Unable to create destination gate");
    return;
  endif
  set_critical(0);
  SetObjProperty( gate1, "GateDestX",  gate2.x  );
  SetObjProperty( gate1, "GateDestY",  gate2.y  );
  SetObjProperty( gate1, "GateDestZ",  gate2.z  );
  SetObjProperty( gate1, "guild_id",   guild_id );
  SetObjProperty( gate2, "GateDestX",  gate1.x  );
  SetObjProperty( gate2, "GateDestY",  gate1.y  );
  SetObjProperty( gate2, "GateDestZ",  gate1.z  );
  SetObjProperty( gate2, "guild_id",   guild_id );
  SetObjProperty( gate2, "guild_id",   guild_id );
EndProgram

Posted: Mon Aug 14, 2006 3:20 pm
by MaximuS
I do not wish to seem impudent, but there is still a couple of questions :) I live in Odessa (Ukraine) and there are commands{teams} for guild as .c (to write inside of guild.). Here a problem: I can not russification a command that it was possible to write the Russian text, and not just English. Here the original of a script->

Code: Select all


use uo;
use os;

program textcmd_c(who,text)

  var guild_pl:= GetObjProperty(who,"guild_id");

  if(!guild_pl)
    SendSysMessage(who,"Cancelled. You are not in a guild.");
    return;
  elseif(!text)
    text:= RequestInput(who,who.backpack,"Input your text:");
    if(!text)
      exit;
    endif
    SendMessage(who,text);
    exit;
  endif

  SendMessage(who,text);

endprogram


function SendMessage(who,text)

  var guild_pl:= GetObjProperty(who,"guild_id");
  var guild:= FindGuild(guild_pl);
  var talkchat:= GetObjProperty(who,"guild_talk");
  var hearchatter, i, guilder;

  if(talkchat == 1)
    foreach person in EnumerateOnlineCharacters()
      guilder:= GetObjProperty(person,"guild_id");
      guilder:= FindGuild(guilder);
      hearchatter:= GetObjProperty(person,"guild_hear");
      if((hearchatter == 1) or (hearchatter == 2) or (hearchatter == 3))
        if(guilder.guildid == guild.guildid)
          SendSysMessage(person,"["+ guild.getprop("guildabv") +"] "+ who.name +": "+ text,3,73);
        endif
      endif
    endforeach
  elseif(talkchat == 2)
    foreach person in EnumerateOnlineCharacters()
      guilder:= GetObjProperty(person,"guild_id");
      guilder:= FindGuild(guilder);
      hearchatter:= GetObjProperty(person,"guild_hear");
      if((hearchatter == 1) or (hearchatter == 2) or (hearchatter == 3))
        if(guilder.guildid == guild.guildid)
          SendSysMessage(person,"["+ guild.getprop("guildabv") +"] "+ who.name +": "+ text,3,73);
        elseif(guilder.isallyguild(guild))
          if((hearchatter == 2) or (hearchatter == 3))
            SendSysMessage(person,"["+ guild.getprop("guildabv") +"] "+ who.name +": "+ text,3,75);
          endif
        endif
      endif
    endforeach
  endif

endfunction
To make a usual chat on Russian it was possible, and here .Ñ

Posted: Mon Aug 14, 2006 3:47 pm
by MaximuS
And still last request... :) I have written myself a simple script on skill stone that it did certain skills and stats BUT after they are put skills can fall in due course on-20... In what there can be a problem? Here a script->

Code: Select all

use uo;
include "include/client";
include "include/attributes";
program setskill( who )
for i := 0 to 48
SetAttributeBaseValue (who, GetAttributeIDBySkillID (i), 0);
var p;
p := 1048576;
endfor
SetAttributeBaseValue (who,GetAttributeIDBySkillID (3), 1200); //ItemID
SetAttributeBaseValue (who,GetAttributeIDBySkillID (16), 1200); //Evaluating
SetAttributeBaseValue (who, GetAttributeIDBySkillID (23), 1200); //Inscript
SetAttributeBaseValue (who, GetAttributeIDBySkillID (21), 900); //anatomy
SetAttributeBaseValue (who, GetAttributeIDBySkillID (25), 1200); //Magery
SetAttributeBaseValue (who, GetAttributeIDBySkillID (26), 1200); //Resist
SetAttributeBaseValue (who, GetAttributeIDBySkillID (47), 900); //Stealth
SetAttributeBaseValue (who, GetAttributeIDBySkillID (32), 1200); //SpiritSpeak
SetAttributeBaseValue (who, GetAttributeIDBySkillID (46), 1200); //Meditation
SetAttributeBaseValue (who, GetAttributeIDBySkillID (0), 1200); //Alchemy


SetAttributeBaseValue (who, "Strength", 1200);
SetAttributeBaseValue (who, "Intelligence", 1500);
SetAttributeBaseValue (who, "Dexterity", 300);
RecalcVitals (who);
SendSysMessage (who, "You now a Mage!!!");
endprogram
Many thanks once again for the help

Posted: Thu Aug 17, 2006 8:30 am
by MaximuS
Really is not present who there would be nobody could help to me? :cry:

Posted: Fri Aug 18, 2006 3:50 pm
by Tritan
It sounds like you have skill cap routine, script running someplace that is resetting the skills. Does this happen with the stats also?

Posted: Sun Aug 20, 2006 6:44 am
by MaximuS
stats remain constant... This business the tenth... Simply at me on shard all scripts compiled also are not present the file with *.src for changes... Still such question, at whom that is a script on Guildstone? And that in distropack does not work a strip of guilds when them more than 10 for example and the second line appears empty... Also it is impossible to replace guildmaster's

Posted: Sun Aug 20, 2006 7:17 am
by Tritan
Then it is a script someplace that is resetting the skills at some time interval. Look through you skill gain scripts for something that resets them based on class, race or both.

As for the guild stone goes I am not sure what you mean. It sounds like you are saying that if there are more then 10 members it does not show up properly, or do you mean 10 different guilds?

Posted: Sun Aug 20, 2006 12:26 pm
by MaximuS
Here the example as works statistics of guilds in the world and members of guilds

1page
2page

And in the same script it is impossible to transfer guild the master of the right to other member of guild + voting works, only in case of if everyone will vote, instead of the majority... Whether there is at someone a normal script on guild stone?

Posted: Sun Aug 20, 2006 1:36 pm
by CWO
I had this problem too. I think it was the fact that it was a ratio button going to more than 1 page. Anyway, I changed the button layout so it just uses regular buttons instead of ratio and had the buttons close the gump with the selection instead of selecting and hitting continue.

Posted: Mon Aug 21, 2006 8:01 am
by MaximuS
CWO wrote:I had this problem too. I think it was the fact that it was a ratio button going to more than 1 page. Anyway, I changed the button layout so it just uses regular buttons instead of ratio and had the buttons close the gump with the selection instead of selecting and hitting continue.
CWO you have already normally adjusted script on Guild Stone? If is share it be so it is kind... In advance at it is much grateful.

Posted: Mon Aug 21, 2006 9:20 am
by CWO
basically I removed the Continue and Cancel Buttons which in my script was

var cancel := GFButtonID(240, 426, 5200, 5201, 1);
var ok := GFButtonID(350, 426, 5042, 5043, 1);

I removed both GFSetRadioGroup(rg);

I changed

GFRadioButton(150, rc + 2, 2103, 2104, 0, member.serial);

to

GFButtonID(150, rc + 2, 2103, 2104, 1, member.serial);

then I changed the ending stuff where it sets the prop to you from

Code: Select all

  if(box[ok.keyid])
    foreach k in(box.keys)
      if((k != ok.keyid) and (k != 0))
        choose := k;
        break;
      endif
    endforeach
    SetObjProperty(who, "fealty", choose);
    SendSysMessage(who, "You declare your fealty.");
    sleep(2);
    return 1;
  else
    SendSysMessage(who, "Cancelled", 3, 40);
    sleep(2);
    return 0;
  endif
to

Code: Select all

  if(box.keys)
    foreach k in(box.keys)
      if((k != 0))
        choose := k;
        break;
      endif
    endforeach
    SetObjProperty(who, "fealty", choose);
    SendSysMessage(who, "You declare your fealty.");
    sleep(2);
    return 1;
  else
    SendSysMessage(who, "Cancelled", 3, 40);
    sleep(2);
    return 0;
  endif
These changes will make it so that when you hit the button next to a member, the gump will automatically close selecting that member instead of highlighting and hitting continue (which isnt there anymore), and you just right click the gump to cancel.

Posted: Fri Aug 25, 2006 12:12 pm
by MaximuS
The script does not wish even to be compiled without changes... an error unable find; gump; gump;... You could not throw off guildtone.ecl? In advance at it is much grateful. :roll:

Posted: Fri Aug 25, 2006 6:32 pm
by CWO
You'll have to post the declare fealty function and I can try to change it from there. I cant post the ecl because mine is compiled for 097 and it could very likely crash your shard due to the ecompile versions.