Scripts

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
Breg
New User
Posts: 27
Joined: Sat Dec 09, 2006 11:58 am

Scripts

Post by Breg »

Here are two scripts in particular im having trouble with..

Code: Select all

// Blessing

use os;
use util;

include "../clericaloptions";
include "include/attributes";
include "include/class";
include "include/magic";

program Blessing(who)

        var blessing := GetObjProperty(who, "blessing");
        if (blessing && (blessing > ReadGameClock() ))
             SendSysMessage(who, "You can not assist more");
        else
             bless(who);
        endif
        EraseObjProperty(who, "#castingclericrite");
endprogram





function bless (Who)
	Sendsysmessage(who, "Who do you want to bless?");
	var cast_on:=target(who);
	var piety := CInt( GetObjProperty(who, "Piety") );
        var clergy := GetConcentratingClerics(who, 3);
	if(len(clergy) > 0)
		foreach i in clergy
			piety := piety + CInt(GetObjProperty(i, "Piety") );
			SetObjProperty(i, "ConcentrationResult", 1);
		endforeach
	endif

        PrintTextAbove(who, "Altar Rinovocum");
        ClericalChant(who, 6);

	if (CheckFocus(who, "Spirit", 30) == 0)
		SendSysMessage(who, "This rite requires a Spirit Focus.");
		return;
	endif
	if (CheckFocus(who, "Arcane", 20) == 0)
		SendSysMessage(who, "This rite requires an Arcane Focus.");
		return;
	endif
	if (CheckFocus(who, "Life", 70) == 0)
		SendSysMessage(who, "This rite requires a Life Focus.");
		return;
	endif
	if (CheckFocus(who, "Life", 30) == 0)
		SendSysMessage(who, "This rite requires a Life Focus.");
		return;
	endif
	if (ClericalManaUse(who, 80) == 0)
		SendSysMessage(who, "You do not have enough energy.");
		return;
	endif

	if (!CheckSkill(who, SKILLID_MEDITATION, 75, modify_points(who, SKILLID_MEDITATION, 200)) );
		SendSysMessage(who, "Your thoughts are unfocused.");
		return;
	endif


	var duration := (20 + CInt(piety/4))*60;
	var mod_amount := 5 + CInt(piety/10);


var i,skillname,skillval;
for (i := 0; i <= SKILLID__HIGHEST; i := i + 1)
     skillname := "sk" + CStr(i);
     skillval := GetObjProperty(cast_on, skillname);


	if (skillval == "1")
	DoSkillMod(cast_on, SKILLID_BLACKSMITHY, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_TAILORING, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_TINKERING, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_BOWCRAFT, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_CARPENTRY, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_COOKING, mod_amount, duration);
	DoSkillMod(cast_on, SKILLID_ALCHEMY, mod_amount, duration);
	return 1;
	endif
endfor
	PlaySoundEffect(cast_on, 0x1e4);
	PlayObjectCenteredEffect(cast_on, 0x373a, 10, 10);
Setobjproperty(who, "blessing", ReadGameClock()+60);
	return 1;

endfunction



And another for the same religion to Summon a Mount

Code: Select all

// Gaea's Mount

use os;
use util;

include "../clericaloptions";
include "include/class";
include "include/spawn";

program gaeasmount(who)

        var imaezorsmountserial := CInt(GetObjProperty(who, "ImaezorsMount"));
        var imaezorsmount :=  SystemFindObjectBySerial( imaezorsmountserial );
        var mount := GetEquipmentByLayer(who, LAYER_MOUNT);
        var mountserial := 0;


        if(mount)
             mountserial := GetObjProperty(mount, "serial");
        endif
       
        if(mountserial == imaezorsmountserial && imaezorsmountserial)
             SendSysMessage(who, "You can only have one Mount at a time");
        elseif(!imaezorsmount)
             Createmount(who);
        else
             SendSysMessage(who, "You can only have one Mount at a time.");
        endif
        EraseObjProperty(who, "#castingclericrite");

endprogram

function Createmount(who)

	var piety := GetPiety(who);

        PrintTextAbove(who, "Matris Equus Succurro");
        ClericalChant(who, 5);

	if (CheckFocus(who, "Spirit", 40) == 0)
		SendSysMessage(who, "This rite requires a Spirit Focus.");
		return;
	endif
	if (CheckFocus(who, "Power", 20) == 0)
		SendSysMessage(who, "This rite requires a Power Focus.");
		return;
	endif
	if (CheckFocus(who, "Life", 70) == 0)
		SendSysMessage(who, "This rite requires a Life Focus.");
		return;
	endif
	if (CheckFocus(who, "Earth", 30) == 0)
		SendSysMessage(who, "This rite requires an Earth Focus.");
		return;
	endif
	if (ClericalManaUse(who, 60) == 0)
		SendSysMessage(who, "You do not have enough energy.");
		return;
	endif

	if (!CheckSkill(who, SKILLID_MEDITATION, 55, modify_points(who, SKILLID_MEDITATION, 200)) );
		SendSysMessage(who, "Your thoughts are unfocused.");
		return;
	endif

        if(piety < (RandomInt(20) + RandomInt(10)) )
		SendSysMessage(who, "Your thoughts are unfocused.");
		return;
        endif
       
        var mount := SpawnNPCAtLocation("imaezorsmount", who.x, who.y, who.z);
        SendSysMessage(who, "Immaezor grants you this mount");
       
	SetObjProperty(mount, "master", who.serial);
        SetObjProperty(who, "ImaezorsMount", mount.serial);
	mount.script := "::HolyAnimal";
	RestartScript(mount);

endfunction

Both compile perfectly but do absolutely nothing.. Blessing actually casts but doesnt do the skill mods or show the changes for them, and when I click the button for the Summon mount Rite it does nothing whatsoever.
Post Reply